Repository navigation
feat(i18n): add traditional chinese (zh-tw) ui language - #7801
eviannaive wants to merge 2 commits into
Conversation
Registers 21 translation keys referenced by ForgetSshWorkspaceDialog, HostRemoveDialog, RemoveFolderDialog, and TerminalSshReconnectOverlay (added in stablyai#7753) that were never synced into en.json, and repairs key parity across all locale catalogs. Mechanical output of `pnpm run sync:localization-catalog`; fixes the currently failing verify:localization-catalog lint step on main.
Adds 中文(繁體) to the UI language picker, backed by a full zh-TW catalog. System locales zh-TW / zh-HK / zh-MO / zh-Hant now resolve to the Traditional catalog instead of falling back to English. The catalog is derived from the curated Simplified catalog with OpenCC (cn→twp, Taiwan phrasing: 软件→軟體, 文件→檔案) via the new `pnpm run bootstrap:zh-tw-catalog`, so it inherits every existing glossary/brand repair deterministically instead of re-machine- translating from English. Catalogs load lazily per locale; `load: 'currentOnly'` keeps a zh-TW session from also fetching the Simplified catalog. BRAND_MISTRANSLATIONS moves to its own module to stay under the max-lines ratchet.
|
Caution Review failedAn error occurred during the review process. Please try again later. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
📝 WalkthroughWalkthroughThis change adds Traditional Chinese (zh-TW) as a supported UI language. Shared locale utilities gain a new constant and normalization/resolution logic for zh-TW. Main and renderer i18n modules add lazy-loading support for the zh-TW catalog with a 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
config/scripts/repair-locale-catalog.mjs (1)
42-49: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueStandalone
--locale zh-TWruns silently depend onzh.jsonalready being fresh.The bootstrap branch regenerates
zh-TW.jsonfrom whateverzh.jsoncurrently contains. That's correct when driven throughDEFAULT_LOCALES(zh before zh-TW), but if someone runsnode repair-locale-catalog.mjs --locale zh-TWdirectly, it will silently derive from a potentially stalezh.jsonwith no warning.Consider logging a note (or asserting recency) when zh-TW is repaired standalone, to prevent accidentally publishing a zh-TW catalog derived from stale Simplified Chinese data.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 555e7f7c-035b-4167-9aaa-aface2330572
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (22)
config/scripts/bootstrap-zh-tw-catalog.mjsconfig/scripts/locale-brand-mistranslations.mjsconfig/scripts/locale-translation-policy.mjsconfig/scripts/repair-locale-catalog.mjspackage.jsonsrc/main/i18n/main-i18n-lazy-locale.test.tssrc/main/i18n/main-i18n.tssrc/renderer/src/components/settings/AppearancePane.test.tsxsrc/renderer/src/components/settings/appearance-search.tssrc/renderer/src/i18n/i18n.tssrc/renderer/src/i18n/lazy-locale.test.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh-TW.jsonsrc/renderer/src/i18n/locales/zh.jsonsrc/renderer/src/i18n/supported-languages.tssrc/shared/ui-language.test.tssrc/shared/ui-language.tssrc/shared/ui-locale.test.tssrc/shared/ui-locale.ts
|
Hi there, we'd like to support more languages! doing a bit refacotring in our i18n implementation so that we can easily support more. give us a few days to land this PR |
|
Thank you for putting this together — and I am sorry it sat unanswered for so long, which is on us, not you. We are not taking on new UI locales right now. Orca ships en/es/ja/ko/zh, and each one carries ongoing cost beyond the initial catalog: every new English string has to be re-translated, the build-time repair policy needs per-locale glossary and override rules, and mistranslations reach users in surfaces nobody on the team can read. We are currently working through a backlog of correctness bugs in the five we already ship, and adding a sixth before that is under control would not be fair to the people using it. That is a decision about our capacity, not about the quality of your work. Closing so the queue reflects reality rather than leaving it open indefinitely — if that changes, this is easy to reopen and we will come back to the contributors who offered first. Thanks again for the time you put in. |
|
I'm sorry — I closed this, and that was the wrong call. Reopening it. The reasoning I gave (that we aren't taking on new built-in locales right now) is still true, but closing your PR was not the right way to act on it. You did the work, it sat for months without a reply, and then it got closed with an explanation of our constraints. That's a bad trade for you, and I apologize. Here's what's actually going on. We do want these locales. What we can't currently take on is maintaining them in-tree, where every new English string becomes translation debt across every catalog and a mistranslation ships to users in a surface nobody on the team can read. So the direction we're working toward is the one where that maintenance sits with the people who actually speak the language: plugin language packs. Most of that mechanism is already in the repo today:
The test fixture for that manifest contract uses What's not there yet is the part that would make this pleasant for you: there's no authoring guide, no scaffolding to generate a starter catalog from I'd rather leave this open and come back to you when that lands than close it and have you find out from a changelog. If you'd prefer to close it yourself in the meantime, that's entirely your call — but it should be yours, not mine. Thanks for the work, and sorry again for how I handled it. |
|
Thank you for this! Traditional Chinese (Taiwan) is now a built-in UI language as of #29795: 繁體中文(台灣) in Settings → Appearance → Language. It's picked automatically for zh-TW, zh-HK, zh-MO and zh-Hant system locales, while zh-CN, zh-SG and zh-Hans stay on Simplified. Your work here fed into the terminology choices, including Taiwan wording like 電腦 and 分頁. Closing this one in favor of that PR. If you spot wording that reads wrong to a Taiwanese user, a follow-up PR against |
Summary
Adds Traditional Chinese (中文(繁體),
zh-TW) as a UI language.zh-TWlocale in the language picker (Settings → Appearance → Language).zh-TW/zh-HK/zh-MO/zh-Hantnow resolve to the Traditional catalog instead offalling back to English.
cn→twp, Taiwan phrasing:软件→軟體, 文件→檔案) with the new
pnpm run bootstrap:zh-tw-catalog— deterministic, offline,byte-reproducible, and it inherits every existing glossary/brand repair instead of re-machine-translating
~10k strings from English.
pnpm run repair:locale-catalogregenerates zh-TW right after zh, keeping the locale inside the standardmaintenance flow.
load: 'currentOnly'keeps a zh-TW session fromalso fetching the Simplified catalog.
Screenshots
Testing
pnpm lint— all steps pass exceptlint:switch-exhaustiveness, which already fails onmaininsource-control-manual-review-url.ts(unrelated file, predates this PR)pnpm typecheckpnpm test— full vitest suite diffed against a clean HEAD baseline: zero regressions (the onlyfailures are local-environment ones identical on the baseline)
pnpm build—zh-TW-*.jsemitted as its own lazy chunkpnpm run verify:localization-catalog— 10,190-key parity across all six catalogsacross restart
(
zh-TW/zh-HK/zh-MO/zh-Hant), lazy catalog loading (renderer + Electron main), and the settingslanguage picker option.
AI Review Report
AI review (8 angles: line-by-line, removed-behavior audit, cross-file trace, reuse, simplification,
efficiency, altitude, conventions; adversarially verified) checked:
path.join; no shortcuts, labels, or shell behavior changed.renderer/main bundles regardless of workspace backing.
Jira, …) are protected from translation by the policy tables, with a zh-TW-specific mistranslation table.
load: 'currentOnly'verifiedbehavior-neutral for existing locales against i18next source; reviewer-found waste in the bootstrap script
(double repair pass, per-call regex compilation) was fixed.
Simplified-character leftovers and intact
{{placeholders}}.Review-found maintainability issues (zh-TW missing from the repair pipeline, duplicated CJK-spacing guards,
copy-pasted menu-label repairs) were fixed in this PR.
Security Audit
AI security review found no new input handling, command execution, auth, secrets, IPC, or path handling
risks. One new devDependency (
opencc-js) is used at build time only; runtime changes are catalog data andlocale resolution. No follow-up security work needed.
Notes
ELI5
Traditional Chinese (
zh-TW) is a full UI language, including system locales like Hong Kong/Macau. The catalog is generated from Simplified Chinese with Taiwan phrasing.