fix(desktop): localize the native file and save dialog titles - #5179
Open
orangeCatDeveloper wants to merge 1 commit into
Open
fix(desktop): localize the native file and save dialog titles#5179orangeCatDeveloper wants to merge 1 commit into
orangeCatDeveloper wants to merge 1 commit into
Conversation
The open and save panels carried English titles in every locale, so a zh user picking a reference folder or saving a conversation read the one English string on an otherwise translated screen. `All Files` was the worst of them: the panel lists it beside the OS's own localized entries. Format names (`Markdown`, `Skill Markdown`, `PNG and JPEG`) stay in English — they identify a file format rather than a product concept. Deletes runtime-host-boot-copy.ts, whose only importer was its own test. Generated-by: Claude Code
me2seeks
approved these changes
Sep 11, 2026
me2seeks
left a comment
Contributor
There was a problem hiding this comment.
PR 5179 Review
结论
APPROVE
七个 native 对话框标题/过滤器名移入带类型的 nativeFileDialogCopy 目录,三个 register 函数获得与 createPermissionOverlayMain 同形的 resolveLocale 依赖;删除的 runtime-host-boot-copy.ts 确无生产引用。
发现
无
不确定性(不发到 GitHub 的疑虑)
- 新增测试
native-file-dialog-copy.test.ts断言 zh-CN/zh-TW 每个字符串"与 en 不同且含汉字"。对importSkillSource(含 "Skill" 拉丁词)这类键,"与 en 不同"在 zh 翻译恰好等于英文时会误报,但当前三个 locale 值均不同,测试通过;属测试健壮性偏好,不发。 app-icon-ipc.ts:179的 showOpenDialog 仍无 title(走 OS 默认),PR 声称覆盖"否则翻译界面上的一个英文字符串"——OS 默认标题本身是本地化的,不算遗漏,故不发。runtime-host-boot-copy.ts的文案已存在于native-diagnostic-dialog-copy.ts(已确认 "Maka workspace needs repair" / "Keep Offline" 在后者中),删除是去重而非丢失;未逐字 diff 两处的完整 90 行对应,风险极低。
✅ 对抗性审查(第一性原理 + 奥卡姆剃刀 + 证据核对)通过:未发现真实的 P0–P3 问题。@me2seeks 请把关是否 merge。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The native open and save panels carried English titles in every locale. A zh user picking a reference folder, adding attachments, importing a Skill or a pet, or saving a conversation read the one English string on an otherwise translated screen.
All Fileswas the worst of the set: the file-type dropdown lists it directly beside the OS's own localized entries, so the panel reads half-translated.Seven strings move into
native-file-dialog-copy.ts, a typedUiCatalogbeside the existingproject-picker-copy.ts. Two call sites (markdown-save-ipc-main.ts,pet-pack-import.ts) andruntime-host-skills-ipc-main.tsgain aresolveLocaledependency, the formcreatePermissionOverlayMainalready uses; the lower-levelmarkdown-save-main.tsstill takes a plain string, so nothing below the IPC boundary starts depending on a catalog.Format names stay in English on purpose:
Markdown,Skill MarkdownandPNG and JPEGidentify a file format, not a product concept, and translating them would add noise rather than clarity.This also deletes
runtime-host-boot-copy.ts— 90 lines of trilingual catalog whose only importer was its own test. The live copy for that surface isnative-diagnostic-dialog-copy.ts.Refs #2672
Verification
The five failures are
browser-message-box, red on the unmodified base (7 tests, 5 fail), unrelated to this diff.The new test asserts every key differs from its English value and carries Han text in both Chinese locales, so a forgotten translation fails rather than silently shipping English.
Review focus
dialog.titleis honoured on Windows and Linux; macOS does not render it on the native panel. The change is still correct there —All Filesappears in the file-type dropdown on all three platforms — but a macOS screenshot would not show the titles.main.ts'sshowErrorBox('Maka Dev', …)is deliberately untouched: it is the catch-path fallback for a development-only single-instance dialog whose main path already resolves the system locale throughDEV_SINGLETON_COPY.AI use
Select exactly one:
Tool(s) and scope: Claude Code — located the untranslated sites, wrote the catalog and the locale plumbing, the test, and this description. The zh-CN/zh-TW wording and the decision to leave format names in English were the contributor's. The commit carries a
Generated-by: Claude Codetrailer.Checklist
Does this PR entail a change in behavior?
All Filesfilter label now follow the Desktop locale