fix(welcome): name the platform's file manager, not Finder (#2265)

On Windows and Linux several places still named macOS's Finder: the recent-project row menu (Show in Finder), Settings › Version Control › Confirmation › When patch is created, the question after a patch is saved, and the reveal error. The wording was an English literal at each call site, one place sniffed the user agent, and the catalogs only had Finder's text. Shared helpers in src/platform/fileManager.ts now name Finder / Explorer / Files from the platform info, and the project view's Reveal action, the editor tab menu, the project tree menu, the welcome page and the patch flow use them, with whole-sentence catalog entries so each locale can translate them.

Co-authored-by: emanyzwww <[email protected]>
Цей коміт міститься в:
Emanyzwwwтаemanyzwww authored and GitHub committed 2026-11-09 17:51:48 +08:00
1 джерело 16ebb6fde8
коміт 5d3432a000
20 files changed
+198 -36

No files matched your search

+22
Переглянути файл
@@ -0,0 +1,22 @@
import { afterEach, expect, it } from "vitest";
import { _resetI18nForTests, setLocale, tx } from "@/platform/i18n";
import { usePlatform } from "@/platform/platformInfo";
import { patchSavedBody } from "../patches";
afterEach(() => _resetI18nForTests());
it.each([
["macos", "Patch file created successfully. Show it in Finder?", "补丁文件已创建。是否在访达中显示?"],
["windows", "Patch file created successfully. Show it in Explorer?", "补丁文件已创建。是否在资源管理器中显示?"],
["linux", "Patch file created successfully. Show it in Files?", "补丁文件已创建。是否在文件管理器中显示?"],
])("asks to show the saved patch in the %s file manager", async (os, english, chinese) => {
const previous = usePlatform.getState().os;
try {
usePlatform.setState({ os });
expect(patchSavedBody()).toBe(english);
await setLocale("zh");
expect(tx(patchSavedBody())).toBe(chinese);
} finally {
usePlatform.setState({ os: previous });
}
});