Repository navigation
feat(i18n): complete Traditional Chinese desktop translation - #22402
hungchihsueh wants to merge 14 commits into
Conversation
Adds Traditional Chinese as a selectable UI language and wires it through both the renderer and the main process. ## What - `src/renderer/src/i18n/locales/zh-TW.json` — 11,794-entry catalog. - `zh-TW` registered in `SUPPORTED_UI_LOCALES`, `BuiltInUiLanguage`, the language picker, and the lazy locale loaders on both sides of the IPC border. - `normalizeSupportedUiLocale` now maps the Traditional-script system locales (`zh-TW`, `zh-HK`, `zh-MO`, `zh-Hant*`) to `zh-TW`; every other `zh-*` tag still resolves to the Simplified catalog. Before this change they all fell back to English. - `settings.appearance.language.traditionalChinese` added to en/zh/ja/ko/es so the option is labelled in every locale, not only in zh-TW itself. en.json is the source of truth for `verify-localization-catalog`, so a zh-TW-only key fails the lint gate. ## Translation quality The catalog started as a script conversion of zh.json, so it carried the usual OpenCC phrase-table damage and a lot of Mainland vocabulary. Both are fixed: - Over-converted words (Traditional glyphs, wrong term): 許可權→權限, 全域性→全域, 型別→類型, 控制元件→控制項, 高階→進階, 引數→參數, 釋出→發布, 進位制→進位, 賬→帳, 臺→台, 例項, 對映, 映象, 擴充套件, 首選項, 稽核, 只讀→唯讀. - Taiwan usage: 本地→本機, 評審→審查, 倉庫→存放庫, 配置→設定, 選項卡/標籤頁→分頁, 訪問→存取, 當前→目前, 計算機→電腦, 程序→行程, 匹配→符合, 後台→背景, 更改→變更, 自定義→自訂, 地址→位址, 身份→身分, 重置→重設, 禁用→停用, 構建→建置, 埠→連接埠. 存放庫 and 連接埠 follow the VS Code / GitHub zh-TW UI. - Terms Taiwan developers keep in English are no longer translated: Token, fast-forward, Agent, Session, Clone. - Outright mistranslations: "Mermaid Diagram" rendered as "M z圖", five "on SSH host" labels had dropped SSH, both "Grab" and "Hold" became 抓住, and Git URL / Git Username lost the brand casing. - Running the repo's own repair policy over the catalog restored 39 code literals that machine translation had localized (MD→醫學博士, PLAN.md→計劃.md, /pricing→/定價, throw src/auth→丟擲 src/auth) and re-spaced 97 CJK/Latin runs. ## Toolchain zh-TW is registered with the localization policy so `sync:localization-catalog` maintains it rather than reverting it: generic-term renderings, brand mistranslations, `NATIVE_PICKER_LABELS`, and the CJK/Latin spacing locale list. zh-TW has zero drift against `repairTranslatedValue` (zh currently has 648). `NATIVE_PICKER_LABELS` is now a single shared object, since the language endonyms are identical in every catalog and must never be script-converted — that is what kept 中文(简体) Simplified inside the Traditional catalog. A zh-TW key override was added for the two bare "Cursor" labels that name the on-screen cursor: `NEVER_TRANSLATE_VALUES` pins the value to English before `isScreenCursorContext` can exempt it. ## Tests - `zh-tw-traditional-usage.test.ts` gates the script (no Simplified-only characters outside the Simplified endonym) and the glossary, so neither pasted Simplified text nor a reverted term can land unnoticed. - The renderer and main lazy-loader specs assert zh-TW serves 檔案 rather than falling back to the zh catalog's 文件 — zh-TW is the only region-tagged loader key, so an i18next code-formatting or fallback-hierarchy regression would otherwise be silent. - zh-TW added to the locale lists in the link-routing localization spec, the repair-catalog missing-leaves spec, and the macOS TCC repair-idempotence spec. Co-Authored-By: Claude Opus 5 <[email protected]>
Copilot review: the Repo generic renderings listed 倉庫 as an acceptable zh-TW form while zh-tw-traditional-usage.test.ts rejects it, so repairTranslatedValue would preserve Mainland wording that the gate then fails on. Added zh-TW phrase fixes that rewrite 倉庫/儲存庫 to 存放庫 when the English mentions a repo. The generic renderings intentionally keep both forms so the brand revert leaves them translated rather than rewriting them to Latin — the phrase fix, which runs after it, is what normalizes them. repair now returns 存放庫 for both, so the policy and the gate agree on the output. Cross-checked all 47 gated terms against the generic-term, brand, value, key-override and phrase-fix tables: 倉庫 was the only contradiction. 智慧體 is consistent, since the brand table reverts it to Agent, which is what the gate wants. Also gated 儲存庫, which the test had missed. CodeRabbit review: trimmed the test's file header to one comment per the repo comment guidance. Tests: pnpm lint passes; i18n/shared/config suites pass; zh-TW policy drift stays at 0. Co-Authored-By: Claude Opus 5 <[email protected]>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThe changes add Traditional Chinese as a supported UI language. Chinese region and script tags can resolve to zh-TW, and the renderer and main process can load its catalog. The language picker, search keywords, locale repair tools, and terminology rules now include Traditional Chinese support. Tests cover locale resolution, catalog repairs, translated labels, and switching the desktop settings interface to Traditional Chinese. Fixed issue severity: Medium Priority: ➖ Normal Merge Risk: 🔵 Low · up to French remains selectable, but the settings documentation may lead users to think it is unavailable. This does not block merging; add it to the language list. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Out of Scope Changes checkExplanation The PR includes an unrelated documentation change in
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.
Important
The new Taiwan-terminology guard does not catch several Mainland forms still in the shipped zh-TW catalog — most notably AI agents rendered as 特工 ("secret agent", including child agents → 兒童特工). These are concrete strings, not style preferences: the same catalog already uses the Taiwan form elsewhere. Please review the specific keys below and extend the guard before merging.
Reviewed changes
- Locale wiring —
zh-TWjoinsSUPPORTED_UI_LOCALES/BuiltInUiLanguage, the renderer and main lazy loaders, the settings picker and search index, and system-locale detection (zh-TW/zh-HK/zh-MO/zh-Hantnow resolve tozh-TWinstead of English). - Fallback separation — both i18next instances set
load: 'currentOnly', so a missingzh-TWkey falls back to English rather than the Simplifiedzhcatalog. Confirmed a valid option in i18next 26.3.1: it yields the hierarchy['zh-TW','en']. - Catalog —
zh-TW.jsonreaches fullen.jsonparity (14,500 keys, 0 missing, 0 placeholder drift) and is repair-stable under the current policy. - Policy + tests — brand-mistranslation, generic-term, phrase-fix, key-override, and native-picker-label tables gained
zh-TW; new unit tests plus a hidden-Electron e2e language-switch spec.
⚠️ Taiwan-terminology guard misses Mainland forms still in the catalog
FORBIDDEN_TERMS in zh-tw-traditional-usage.test.ts is the only automated net for wrong vocabulary, and these slip through. Each is contradicted either by the PR's own normalization rule or by the dominant form in the same catalog:
特工×5 — AI "agent" rendered as a secret agent.All 1 detected agent has the skill.→所有 1 名檢測到的特工…;child agents→兒童特工;Agents spawned→特工產生. The catalog usesAgent540×.反饋×15 — Taiwan is回饋; the whole Feedback dialog uses反饋.鏈接×7 vs連結×267 —Orca skill link→Orca 技能鏈接, plusUnlisted skill links,Active shared links, …信息×2 vs資訊/訊息×135 —Update Orca to see the details→更新 Orca 以查看詳細信息.內存×1 vs記憶體×12 — status-barprivateBytesDescription.主頁×6 — Taiwan is首頁;Default Home Page,homepage,Home page saved.存儲庫×1 —Repository details are unavailable for this check.→…存儲庫詳細資訊; the PR normalizes儲存庫/倉庫→存放庫but not this variant.隊列×2 vs佇列×9 —Queue {{count}} PR.
Fixing this needs both extending the guard (so it fails until the strings are corrected) and correcting the strings, either by hand or via unconditional zh-TW phrase fixes.
Technical details
# Taiwan vocabulary still present in zh-TW.json
## Affected sites
- src/renderer/src/i18n/zh-tw-traditional-usage.test.ts:18-79 — `FORBIDDEN_TERMS` omits 反饋/鏈接/信息/內存/主頁/特工/存儲庫/隊列.
- src/renderer/src/i18n/locales/zh-TW.json — the offending values (GitHub renders the file as binary, so they are not in the diff):
- auto.components.settings.OrchestrationSkillAgentCoverage.fullCoverage_one/_other/partialCoverage — 特工
- auto.components.settings.orchestration.search.f5d39af41e — 兒童特工
- auto.components.mobile.slides.HomeSlide.00a6903322 — 特工產生
- auto.components.sidebar.SidebarFeedbackDialog.* and auto.components.browser.pane.BrowserPane.* — 反饋 (15)
- auto.components.skills.SkillInstallReviewContent.93eb0fe8c7, auto.components.settings.shareSkills.*, auto.components.settings.artifacts.* — 鏈接 (7)
- auto.lib.browser.cookie.import.toast.unrecognizedWarning / undecryptableUnrecognizedReason — 信息 (2)
- auto.components.status.bar.resource.memory.metric.privateBytesDescription — 內存
- auto.components.settings.BrowserHomePageSetting.*, auto.components.settings.Settings.ad9788036f, auto.hooks.useSettingsNavigationMetadata.e815fd01bd — 主頁 (6)
- auto.store.slices.editor.checkRunDetailsRepoUnavailable — 存儲庫
- auto.components.right.sidebar.github.pr.stack.confirmation.92ca033e72 / 478a527b15 — 隊列
- config/scripts/locale-phrase-fixes.mjs:386-397 — only the repo variants are normalized; nothing rewrites the forms above.
## Required outcome
- The guard rejects the eight forms above and the catalog no longer contains them.
- A repair run over zh-TW keeps those terms out (add unconditional `zh-TW` phrase fixes, or equivalent).
## Suggested approach (optional)
- Add the terms to `FORBIDDEN_TERMS` (see inline suggestion).
- Add unconditional `zh-TW` phrase fixes for the unambiguous forms (`反饋→回饋`, `鏈接→連結`, `信息→資訊`, `內存→記憶體`, `主頁→首頁`, `特工→Agent`, `存儲庫→存放庫`, `隊列→佇列`) and regenerate `zh-TW.json`.
- If any of these is a deliberate choice, record the Taiwan form instead rather than dropping the guard.
## Open questions for the human
- Is a native-speaker pass planned for the remaining ~37 strings, or should this ship as-is with the guard documenting the known gaps?ℹ️ Nitpicks
src/renderer/src/i18n/settings-status-label-localization.test.tsLOCALE_CATALOGSstill covers onlyes/ja/ko/zh;zh-TWis now a full shipped catalog with 40 plural keys, so it can join the shipped-catalog placeholder/plural assertions.config/scripts/locale-brand-prefilter-benchmark.mjsiterates['zh','ja','ko','es','fr']; addingzh-TWkeeps the benchmark representative.docs/site/content/docs/settings.mdx:31lists the Language choices without繁體中文(French is already absent, so the list is stale regardless).
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
ℹ️ No critical issues — the prior terminology findings are addressed; a few additional Mainland forms still slip the guard (inline).
Reviewed changes
- Terminology guard extended — added unconditional
zh-TWphrase fixes for the eight Mainland forms flagged in the prior review (反饋,鏈接,信息,內存,主頁,特工,存儲庫,隊列), corrected the 39 affected catalog entries, and added those terms toFORBIDDEN_TERMSwith a per-term repair test. - Artifact / child-Agent copy — added contextual
zh-TWfixes (文物|神器|工件|Artifacts→成品,兒童→子,派遣工|工人→工作者) and rewrote the affected artifacts/worker strings. - Child-agent toggle localization —
DashboardAgentChildDisclosureand the sidebar compact row now localizeShow/Hide/agent/agentsthrough newcommon.childAgentDisclosure.*keys instead of hardcoding English, with a rendered test. - New catalog translations — translated the newly landed settings and Muse usage strings into
zh-TW.jsonand dropped the two obsolete hash keys (60002bb22f,f28ff1f852) replaced upstream. - Locale follow-through — added
zh-TWto the brand-prefilter benchmark, macOS TCC prompt test, and settings-status test catalogs; updated the docs language list (also restoredFrançais).
Verified at head: verify:localization-catalog → zh-TW 14,524/14,524, 0 missing; a simulated repair run over the shipped catalog is a no-op; a FORBIDDEN_TERMS scan returns 0 hits.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Remaining Mainland forms corrected —
文件夾→文件資料夾,緩存→快取,插件→外掛,創建→建立,嵌套→巢狀, and線程→討論串/執行緒(CPU threads only) now have unconditionalzh-TWrepair rules, with context-specific key overrides where a word swap alone would read awkwardly. - Guard extended —
FORBIDDEN_TERMSinzh-tw-traditional-usage.test.tsnow rejects those six forms, andlocale-translation-policy.zh-tw-terms.test.mjscovers each repair plus the CPU-thread vs discussion-thread split. - Key-override wiring — the new
locale-zh-tw-key-overrides.mjsis merged last inmergeLocaleKeyOverrides, so the context values win over the base and cross-locale tables. - Docs language list — trimmed to the shipped picker choices (
繁體中文in;Français/Langueout, matchingUI_LANGUAGE_CHOICES).
Verified at head: verify:localization-catalog → zh-TW 14,524/14,524, 0 missing; a simulated repairCatalog(en, zh-TW, 'zh-TW') returns 0 leaf changes; a FORBIDDEN_TERMS scan over the shipped catalog returns 0 hits; 130 focused locale tests pass.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
🟡 Minor · Add French to the documented interface languages. · settings.mdx:31
docs/site/content/docs/settings.mdx:31
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winAdd French to the documented interface languages.
The settings picker exposes French when users open Settings → Appearance → Interface. The documentation omits it, so users may incorrectly assume that French is unavailable.
Suggested fix
-- **Language** — primary Interface control. Switch between System (follows the OS), English, 中文(简体), 繁體中文, 한국어, 日本語, or Español. Settings search also matches native words for “language” (语言 / 語言 / 언어 / 言語 / Idioma) so you can find Language while the UI is still in English. +- **Language** — primary Interface control. Switch between System (follows the OS), English, 中文(简体), 繁體中文, 한국어, 日本語, Español, or Français. Settings search also matches native words for “language” (语言 / 語言 / 언어 / 言語 / Idioma) so you can find Language while the UI is still in English.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 9a0c3d91-7690-4608-a24c-b22df6e7e23c
📒 Files selected for processing (6)
config/scripts/locale-key-override-merge.mjsconfig/scripts/locale-phrase-fixes.mjsconfig/scripts/locale-translation-policy.zh-tw-terms.test.mjsconfig/scripts/locale-zh-tw-key-overrides.mjssrc/renderer/src/i18n/locales/zh-TW.jsonsrc/renderer/src/i18n/zh-tw-traditional-usage.test.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.
|
The French documentation finding compares an intermediate commit rather than the current base-to-head PR diff. In the current PR patch for docs/site/content/docs/settings.mdx, the only change is adding 繁體中文; the upstream base already omits Français and Langue. French remains selectable in the app, but documenting it is a pre-existing, separate docs issue, so this zh-TW PR should not add unrelated French changes. |
* feat(i18n): add Traditional Chinese (zh-Hant) UI locale Adds 繁體中文 as a selectable UI language and derives its catalog from zh.json rather than translating English afresh, so the reviewed Simplified terminology and Orca glossary decisions carry over. The conversion needed three corrections beyond OpenCC's `cn -> twp`: - One pass only. `twp`'s phrase dictionary is not idempotent (it maps 進程->程序 and 程序->程式), and iterating to a fixed point makes output worse: it rewrites the correct Taiwan 游標 to 遊標, and 程序 to 程式 where the source meant an OS process. - 16 terms where `twp` emits a form Taiwan does not use, each confirmed against Microsoft's VS Code zh-Hant language pack (許可權 0 vs 權限 84, 賬戶 0 vs 帳戶 111, and so on). - 進程 vs 程序 collapse in `twp` output. Taiwan calls an OS process 行程, so the generator consults the Simplified source to disambiguate; daemon copy reads 守護行程, not 守護程式. Also pins `load: 'currentOnly'` on both i18next instances. i18next's default expands `zh-Hant` into ['zh-Hant', 'zh', 'en'], so a key missing from the Traditional catalog would silently render Simplified. zh-Hant.json is generated and compared byte-for-byte, so the new check is wired into verify:localization-catalogs to fail when a Simplified edit skips regeneration. Refs #10592 Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(i18n): fail the zh-Hant check on an unreadable zh.json The generator caught every error from reading and parsing zh.json, so a malformed or unreadable Simplified catalog logged "absent here" and exited 0 without ever comparing the generated Traditional catalog. Only ENOENT means there is nothing to derive, so every other failure now propagates. Tests cover the three paths the catch was conflating: an absent zh.json still passes for the combined verifier's synthetic fixtures, malformed JSON throws, and a directory where the catalog belongs throws EISDIR rather than reporting the file as missing. Co-Authored-By: Claude Code <[email protected]> * feat(i18n): ship Traditional Chinese (Taiwan) as a maintained built-in catalog Keeps the zh-Hant locale from this PR and makes it a hand-maintained catalog like the other built-ins, without the OpenCC generator: - Catalog reconciled with current en.json. Per key it prefers the Taiwan-reviewed copy from #22402 (which carries #14223), falls back to the zh-derived copy here, and drops entries whose English changed. A review pass then applied Taiwan terms (代理程式, 工作階段, 存放庫, 分頁, 列/欄) and 「」 quotes. Glossary: config/i18n-traditional-chinese.md. - Label 繁體中文(台灣)in every catalog, the picker, onboarding and search. - Detection maps zh-TW/zh-HK/zh-MO/zh-Hant* to zh-Hant; zh-CN/zh-SG/zh-Hans stay on zh. Both i18next instances use load: 'currentOnly' so missing keys fall back to English, not Simplified. - Drops opencc-js, the generator scripts and their verify hook. Co-authored-by: hungchihsueh <[email protected]> Co-authored-by: chilung-cgu <[email protected]> * feat(i18n): translate remaining Traditional Chinese (Taiwan) catalog keys Fill the 2,043 keys added to en since the source PRs branched, following the Taiwan glossary, and extend the glossary with skill, automation, usage, review, token and related terms. * fix(i18n): review Traditional Chinese (Taiwan) catalog wording Apply 629 reviewed corrections across the full catalog: 30 meaning or untranslated-text fixes and 599 glossary and phrasing fixes (終端機, 用量, API 金鑰, clearer counts and actions). Each edit was cross-checked by an independent review pass. * fix(i18n): polish sampled zh-Hant strings and drop redundant locale test Co-authored-by: Claude <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: OrcaWin <[email protected]> Co-authored-by: hungchihsueh <[email protected]> Co-authored-by: chilung-cgu <[email protected]>
|
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 |

ELI5
Desktop users can choose Traditional Chinese in Appearance → Language. The desktop interface, menus, dialogs, and settings use Taiwan wording after the switch.
What Changed
zh-TWto the existing desktop language selection and locale loaders, including system locale detection for Traditional Chinese tags.zh-TWseparate from Simplified Chinese in i18next fallbacks; added settings-search, catalog-maintenance, terminology, and rendered-app coverage.Why
The existing Traditional Chinese PR #14223 contains useful translation work but predates thousands of current desktop strings. This PR carries its author commits forward and refreshes the catalog against current
main. I cannot update that PR's branch, so this is a new PR. Credit for the original locale work goes to @chilung-cgu.Linked Issue
Fixes #10592
Visual Proof
English settings before the switch:
Traditional Chinese settings after the switch:
Both screenshots come from the hidden Electron Playwright test in an isolated test profile.
Testing
pnpm tc,pnpm lint,pnpm run check:code-quality:changed,pnpm run verify:localization-catalog, andpnpm run build:electron-vitepass.pnpm testdid not complete locally: the latest attempt hit failures in cross-version release-checkout, Relay, PTY, and daemon suites, then was stopped. Focused localization tests pass; CI is needed for the full result.AI Disclosure
Codex (GPT-6) assisted the implementation and review. Machine translation and script conversion seeded missing catalog entries; the existing curated catalog was retained, and terminology plus prominent and consequential UI copy were reviewed and corrected. Native-speaker copy review is welcome.
Review
Self-reviewed locale resolution, lazy loading, English fallback, search indexing, catalog parity, placeholders, Taiwan vocabulary, and UI screenshots. The patch does not change runtime permissions, remote protocols, or mobile app localization.
Agent skill upstream boundary
Notes
The standalone Orca Mobile app remains outside this PR. Desktop strings related to Mobile pairing are included in the desktop catalog.
Checklist
pnpm testandpnpm buildneed CI coverage; local focused tests, typecheck, lint, and desktop bundle build are recorded above.