You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(i18n): add Traditional Chinese (zh-Hant) UI locale - #29795
Orca's interface can now be displayed in Traditional Chinese. If your system language is zh-TW / zh-HK / zh-Hant, the app also starts in Traditional Chinese instead of English. The Traditional wording is derived from the existing reviewed Simplified catalog, so the two stay consistent.
What Changed
Added 繁體中文 to the UI language picker (renderer, main process, shared locale lists, settings search).
Added a generated catalog src/renderer/src/i18n/locales/zh-Hant.json (20,153 lines), produced from zh.json by config/scripts/generate-zh-hant-catalog.mjs: one OpenCC cn → twp pass, then 16 reviewed Taiwan-terminology fixes (e.g. 許可權→權限, 賬戶→帳戶) and a source-guided 進程→行程 fix. A --check mode is wired into verify:localization-catalogs, so editing zh.json without re-syncing fails CI. pnpm run sync:zh-hant-catalog regenerates.
Pinned load: 'currentOnly' on both i18next instances. With i18next's default, zh-Hant silently falls back to zh (Simplified) for any missing key; with this pin it falls back to English, which is the only correct fallback.
Fixed locale resolution: zh-TW / zh-HK / zh-Hant used to resolve to English (the default); they now resolve to zh-Hant. zh-MO added as a Traditional region. Bare zh still means Simplified.
Language-picker endonyms (e.g. 中文(简体)) are pinned so no locale ever renames another language in a script its own readers can't read.
New dependency: opencc-js@1.4.2 (locked, dev + build-time only; used by the generator, not shipped to the app runtime).
Why
Deriving from the Simplified catalog rather than translating from English afresh carries over the terminology and glossary decisions the Simplified catalog already settled, and keeps the two Chinese catalogs in lockstep via generation instead of manual drift. The corrections are explicit, reviewable table entries because OpenCC's Taiwan profile is not idempotent — iterating makes output worse (游標→遊標, 程序→程式) — so every deviation is a pinned, corpus-verified rule (hit counts from Microsoft's VS Code zh-Hant language pack recorded in comments). The currentOnly pin was chosen over fixing individual keys because i18next's locale-chain fallback is global: any single missing key would leak Simplified text into the Traditional UI.
N/A — no layout or interaction change; the picker gains one endonym entry and all other text comes from the generated catalog. Reviewers can switch Settings → Appearance → Language to 繁體中文 to see the translated UI.
Testing
Automated tests added/updated: config/scripts/generate-zh-hant-catalog.test.mjs (sync, key parity, placeholder preservation, no Simplified-only glyphs, Taiwan-term pins, endonym pins) plus updates to ui-locale, ui-language, catalog-nested-settings, appearance-search, browser-link-routing-localization, and provider-credit-balance-locales tests (53 tests pass).
verify:localization-catalogs, typecheck, and lint pass locally.
Steps to verify manually: run pnpm run verify:zh-hant-catalog (should pass), then switch the UI language to 繁體中文 and confirm the interface renders Traditional (e.g. 設定 → 權限 shows 權限, not 許可權).
AI Disclosure
Developed with AI assistance (Claude Code): catalog generation, tests, and wiring drafted by the model and reviewed by the human author.
Review
Agent skill upstream boundary
Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.
Checklist
This PR is small and focused
I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
Before/after screenshots or videos attached for UI changes, or N/A with reason
Self-reviewed for correctness, security, and performance
Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)
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 stablyai#10592
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.
No actionable comments were generated in the recent review.
Recent review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 509ecc7d-8577-46f8-93ec-7d1c67d2ddbd
Commits
Reviewing files that changed from the base of the PR and between fa707b5 and 4b02d1a.
Files selected for processing: 2
src/renderer/src/i18n/locales/zh-Hant.json
src/shared/ui-locale.test.ts
Files with no reviewable changes: 1
src/shared/ui-locale.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.
Walkthrough
Adds Traditional Chinese (zh-Hant) as a supported UI language. Chinese locale tags with the Hant script or TW, HK, or MO region resolve to this locale. The main and renderer i18n instances can load its catalog, which contains translations across the application. Language settings, onboarding, appearance search, and locale labels now include the option.
Priority: Normal
Severity of issue fixed: Medium
Merge Risk: Minimal · up to 4b02d
The Traditional Chinese locale is ready to merge after normal checks. Native Taiwan terminology review can continue separately.
Pre-merge checks: 4 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks: 4 passed
Check name
Status
Explanation
Title check
The title clearly and concisely identifies the main change: adding the Traditional Chinese (zh-Hant) UI locale.
Description check
The description includes all required sections, explains the user-visible change and rationale, links issue #10592, provides visual-proof guidance, documents testing, and completes the checklist. Howe…
Linked Issues check
Issue #10592 requires a Traditional Chinese UI catalog, Traditional Chinese locale resolution, and no Simplified substitute for zh-TW and zh-HK users. Reviewed head evidence:
- Catalog: `src/renderer…
Out of Scope Changes check
Every changed file supports the Traditional Chinese locale requested by #10592:
- Locale and language logic: ui-locale.ts, ui-language.ts, their tests, and main-i18n-lazy-locale.test.ts. - Rend…
Full details: Description check
Explanation
The description includes all required sections, explains the user-visible change and rationale, links issue #10592, provides visual-proof guidance, documents testing, and completes the checklist. However, it contains stale implementation details about OpenCC generation and the catalog-check hook that the PR objectives state were removed in favor of a hand-maintained catalog.
Full details: Linked Issues check
Explanation
Issue #10592 requires a Traditional Chinese UI catalog, Traditional Chinese locale resolution, and no Simplified substitute for zh-TW and zh-HK users. Reviewed head evidence:
Catalog: src/renderer/src/i18n/locales/zh-Hant.json exists (raw summary: about 18,011 lines). Per the maintainer report, it covers 16,266 of 16,277 keys. The 11 status-bar balance keys are intentionally absent. The issue does not require full key coverage.
Locale resolution: src/shared/ui-locale.ts adds 'zh-Hant' to SUPPORTED_UI_LOCALES. matchUiLocale maps Hant script and TW, HK, MO regions to zh-Hant. Hans and other regions map to zh. resolveUiLocale maps UI_LANGUAGE_CHINESE_TRADITIONAL to zh-Hant.
Loaders: src/renderer/src/i18n/i18n.ts adds 'zh-Hant' to NON_DEFAULT_LOCALE_URLS. The raw summary reports the same loader addition in src/main/i18n/main-i18n.ts.
Fallback: both i18next instances set load: 'currentOnly'. The code comment states that the default expansion would render Simplified text for missing zh-Hant keys. Missing keys therefore fall back to English.
Language choices and search: UI_LANGUAGE_CHINESE_TRADITIONAL = 'zh-Hant' is added in src/shared/ui-language.ts. Picker, fallback label 繁體中文(台灣), and appearance-search.ts keywords are added.
Tests: the raw summary reports tests for locale normalization, system-locale resolution, lazy loading, the Traditional selection, and English fallback for a Simplified-only key.
I inspected ui-locale.ts and i18n.ts at head. They match the summary. The PR description still describes a generator and OpenCC dependency. The raw summary lists no such files, and the PR objectives state they were removed. This stale description does not change the requirement result. Native Taiwan terminology review remains open. It is a review task, not a coding requirement of the issue.
Full details: Out of Scope Changes check
Explanation
Every changed file supports the Traditional Chinese locale requested by #10592:
Locale and language logic: ui-locale.ts, ui-language.ts, their tests, and main-i18n-lazy-locale.test.ts.
Renderer loading and picker: i18n.ts, supported-languages.ts, appearance-search.ts, lazy-locale.test.ts, and OnboardingLanguageSwitcher.test.tsx. The onboarding test change updates the option count from seven to eight.
Label entries in existing locale catalogs (en.json, zh.json, es.json, fr.json, ja.json, ko.json, pt.json) and config/scripts/locale-translation-policy.mjs. These add the picker label 繁體中文(台灣) for each UI language.
config/vitest.config.ts: the locale-catalog test asset loader now accepts uppercase filenames, which zh-Hant.json requires.
docs/site/content/docs/settings.mdx: documents the new language option.
config/i18n-traditional-chinese.md: a terminology and maintenance guide for the new catalog.
No changed file lacks a connection to the requested locale. The raw summary shows no unrelated refactor or dependency change. The generator and OpenCC dependency described in the PR body are absent from the summary, so they are not out-of-scope changes at head.
Full details: Docstring Coverage
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 3 functions across 13 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
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 <noreply@anthropic.com>
…n 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 stablyai#22402 (which carries stablyai#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 <84211143+hungchihsueh@users.noreply.github.com>
Co-authored-by: chilung-cgu <b0423031@gmail.com>
Maintainer update, pushed to this branch (merge of main plus e3a0f39). Thanks @oahsiao. This is now the Traditional Chinese PR we plan to land.
What changed from the original version
The OpenCC generator is gone. That means opencc-js, generate-zh-hant-catalog*, the locale-zht-* overrides and the --check hook in verify:localization-catalogs are removed. zh-Hant.json is now maintained by hand like pt, fr and the other built-ins. Converting zh text carried mainland terms into the catalog (智慧體, 會話, 倉庫, 標籤頁).
A review pass then applied Taiwan terms: 代理程式, 工作階段, 存放庫, 分頁, 列/欄. It also switched quotes to 「」.
The glossary is in config/i18n-traditional-chinese.md.
14,223 of 16,277 keys are covered. The 2,043 remaining keys (plus the 11 status-bar balance keys, which stay English on purpose) fall back to English (not Simplified) and will be filled in a follow-up.
Label. The language is labeled 繁體中文(台灣) in every catalog, the language picker, onboarding and settings search.
Detection.zh-TW, zh-HK, zh-MO and zh-Hant* map to zh-Hant. zh, zh-CN, zh-SG and zh-Hans* stay on zh. Unknown scripts are still unsupported.
load: 'currentOnly' is kept in both i18next instances. A renderer test now checks that missing keys fall back to English, not Simplified.
…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.
Add a missing-key fallback assertion for the main i18next instance.
The current menu.file assertion does not exercise a key absent from zh-Hant. mainI18n is exported and can accept a test-only Simplified Chinese resource. Add this assertion to detect a regression that makes zh-Hant fall back to zh instead of English.
Suggested fix
+ it('does not fall back to Simplified Chinese for missing Traditional Chinese keys', async () => {+ mainI18n.addResourceBundle(+ 'zh',+ 'translation',+ { mainFallbackProbeOnlyInZh: '简体中文' },+ true,+ true+ )+ await setMainUiLanguage(UI_LANGUAGE_CHINESE_TRADITIONAL)+ expect(translateMain('mainFallbackProbeOnlyInZh', 'English fallback')).toBe('English fallback')+ })+
it('uses caller English when a target catalog omits a key', async () => {
Assert a real missing catalog key without an inline default.
zhOnlyKey returns its supplied defaultValue, so this test can pass even if English fallback stops working. browser.loadFailure.blockedTitle is a real English entry, is absent from zh-Hant, and is already present in the eager English fixture. Assert it without injecting another English resource:
Files skipped from review as they are similar to previous changes: 6
src/renderer/src/i18n/locales/zh.json
src/renderer/src/i18n/locales/ko.json
src/renderer/src/i18n/locales/es.json
src/renderer/src/i18n/locales/ja.json
src/renderer/src/i18n/locales/fr.json
src/renderer/src/i18n/locales/en.json
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.
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.
Maintainer follow-up on top of the earlier update (pushed as 22303ef2c59 and fa707b50294):
Catalog complete: translated the remaining 2,043 keys that were added to en.json after this branch started. zh-Hant.json now covers 16,266/16,277 keys, the same coverage as zh.json. The 11 status-bar balance keys are left out on purpose, as they are in zh.
Full-catalog review: used machine-assisted translation review, with two independent passes per key and a final cross-check of every accepted edit. This applied 629 corrections: 30 meaning or untranslated-text fixes, and 599 glossary and phrasing fixes, mostly 終端機, 用量 and API 金鑰, plus clearer counts and actions. Reviewer suggestions that went against the wording the catalog already uses were not applied. For example, shell, Fork and right-click shortcuts are unchanged.
Glossary: added rows to config/i18n-traditional-chinese.md for skill, automation, workflow, review, diff, stash, sidebar, browser, usage, quota, dictation, shortcut, prompt, context, token, credential, notification, thread, schedule and emulator.
The localization catalog, extraction, coverage and runtime-catalog checks pass, as do tc:web, tc:node and the i18n, onboarding and appearance tests. A native Taiwan reviewer should still sign off on the terminology, especially 代理程式, 工作階段 and 存放庫.
Drop TabGroupDropOverlay.paneColumnLabel from the ru, tr and zh-Hant
catalogs main added (stablyai#29795, stablyai#34717, stablyai#34718). This PR removes the
string and its seven other translations, and the catalog check fails
on a key that en.json no longer has.
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
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.
ELI5
Orca's interface can now be displayed in Traditional Chinese. If your system language is zh-TW / zh-HK / zh-Hant, the app also starts in Traditional Chinese instead of English. The Traditional wording is derived from the existing reviewed Simplified catalog, so the two stay consistent.
What Changed
繁體中文to the UI language picker (renderer, main process, shared locale lists, settings search).src/renderer/src/i18n/locales/zh-Hant.json(20,153 lines), produced fromzh.jsonbyconfig/scripts/generate-zh-hant-catalog.mjs: one OpenCCcn → twppass, then 16 reviewed Taiwan-terminology fixes (e.g. 許可權→權限, 賬戶→帳戶) and a source-guided 進程→行程 fix. A--checkmode is wired intoverify:localization-catalogs, so editingzh.jsonwithout re-syncing fails CI.pnpm run sync:zh-hant-catalogregenerates.load: 'currentOnly'on both i18next instances. With i18next's default,zh-Hantsilently falls back tozh(Simplified) for any missing key; with this pin it falls back to English, which is the only correct fallback.zh-TW/zh-HK/zh-Hantused to resolve to English (the default); they now resolve tozh-Hant.zh-MOadded as a Traditional region. Barezhstill means Simplified.中文(简体)) are pinned so no locale ever renames another language in a script its own readers can't read.opencc-js@1.4.2(locked, dev + build-time only; used by the generator, not shipped to the app runtime).Why
Deriving from the Simplified catalog rather than translating from English afresh carries over the terminology and glossary decisions the Simplified catalog already settled, and keeps the two Chinese catalogs in lockstep via generation instead of manual drift. The corrections are explicit, reviewable table entries because OpenCC's Taiwan profile is not idempotent — iterating makes output worse (游標→遊標, 程序→程式) — so every deviation is a pinned, corpus-verified rule (hit counts from Microsoft's VS Code zh-Hant language pack recorded in comments). The
currentOnlypin was chosen over fixing individual keys because i18next's locale-chain fallback is global: any single missing key would leak Simplified text into the Traditional UI.Linked Issue
Fixes #10592
Visual Proof
N/A — no layout or interaction change; the picker gains one endonym entry and all other text comes from the generated catalog. Reviewers can switch Settings → Appearance → Language to 繁體中文 to see the translated UI.
Testing
config/scripts/generate-zh-hant-catalog.test.mjs(sync, key parity, placeholder preservation, no Simplified-only glyphs, Taiwan-term pins, endonym pins) plus updates toui-locale,ui-language,catalog-nested-settings,appearance-search,browser-link-routing-localization, andprovider-credit-balance-localestests (53 tests pass).verify:localization-catalogs, typecheck, and lint pass locally.Steps to verify manually: run
pnpm run verify:zh-hant-catalog(should pass), then switch the UI language to 繁體中文 and confirm the interface renders Traditional (e.g. 設定 → 權限 shows 權限, not 許可權).AI Disclosure
Developed with AI assistance (Claude Code): catalog generation, tests, and wiring drafted by the model and reviewed by the human author.
Review
Agent skill upstream boundary
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)