Skip to content

feat(i18n): add Traditional Chinese (zh-TW) UI locale - #10604

Open
innocarpe wants to merge 3 commits into
stablyai:mainfrom
innocarpe:feat/zh-hant-ui-locale
Open

innocarpe wants to merge 3 commits into
stablyai:mainfrom
innocarpe:feat/zh-hant-ui-locale

Conversation

@innocarpe

@innocarpe innocarpe commented Jul 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Adds full Traditional Chinese UI catalog (zh-TW) with Taiwan terminology (OpenCC cn→twp).
  • System locales zh-TW / zh-HK / zh-Hant now resolve to zh-TW instead of English.
  • Language picker: 中文(繁體) alongside existing 中文(简体).

Fixes

Closes #10592

Test plan

  • ui-locale / ui-language / lazy-locale tests
  • Manual: Language → 中文(繁體); spot-check settings labels

ELI5

Full Traditional Chinese (zh-TW) UI localization is available, with system locales like zh-TW/zh-HK mapping to it, so Traditional Chinese users get a native language option.

@coderabbitai

coderabbitai Bot commented Jul 25, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Adds Traditional Chinese (zh-TW) as a supported UI language. Locale normalization and resolution recognize Traditional Chinese variants. The settings language selector includes the new option. A complete Traditional Chinese renderer catalog is added. Renderer and main-process i18n loaders lazily load the catalog. Language search keywords distinguish Traditional and Simplified Chinese.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the primary change: adding the Traditional Chinese zh-TW UI locale.
Description check ✅ Passed The description explains the change, motivation, linked issue, ELI5 summary, and automated testing, but omits several template sections and visual proof.
Linked Issues check ✅ Passed The changes implement the linked issue requirements, including the zh-TW catalog, locale resolution, registration, language picker support, and lazy loading.
Out of Scope Changes check ✅ Passed The changes are focused on adding and registering the Traditional Chinese locale and related tests, with no unrelated code changes identified.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: fd57c236-50d0-47be-99f8-36ceffadfbf9

📥 Commits

Reviewing files that changed from the base of the PR and between 9eff372 and 816755f.

📒 Files selected for processing (14)
  • src/main/i18n/main-i18n.ts
  • src/renderer/src/components/settings/appearance-search.ts
  • src/renderer/src/i18n/i18n.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh-TW.json
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/i18n/supported-languages.ts
  • src/shared/ui-language.test.ts
  • src/shared/ui-language.ts
  • src/shared/ui-locale.test.ts
  • src/shared/ui-locale.ts

Comment thread src/renderer/src/i18n/locales/zh-TW.json Outdated
Comment thread src/renderer/src/i18n/locales/zh-TW.json Outdated
Comment thread src/renderer/src/i18n/locales/zh-TW.json
@innocarpe

Copy link
Copy Markdown
Contributor Author

Sync update (d8e160f5e)

Address CodeRabbit: Taiwan terminology pass (電腦/複製/儲存/權限/帳戶), translate first-screen EN leftovers (workspace connect, remote runtime reconnect, agent dashboard). Duplicate sessionId not present in current catalog. Residual: ~600 non-core strings still match English (product names, Linear prompts, deeper settings).

@nwparker nwparker added the enhancement New feature or request label Jul 27, 2026
@nwparker

nwparker commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

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.

@nwparker nwparker closed this Aug 4, 2026
@nwparker

nwparker commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

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:

  • a plugin manifest declares contributes.languagePacks: [{ locale, path }]
  • the pack is a plain catalog JSON with the same key shape as src/renderer/src/i18n/locales/en.json
  • packs are content-integrity verified and approval-gated at install, then registered into i18next at runtime
  • they appear in Settings → Appearance → Language next to the built-in locales
  • Intl formatting — dates, relative times, number formats — resolves through the locale tag the pack declares

The test fixture for that manifest contract uses pt-BR as its worked example, so this isn't hypothetical plumbing.

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 en.json, no re-sync story when English strings change, and the glossary/repair tooling we use for the built-in locales isn't exposed to pack authors. That's the work in front of us. I'm not going to give you a date I can't keep.

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.

@innocarpe

Copy link
Copy Markdown
Contributor Author

@nwparker Thanks for the clarification, and for reopening the PR.

I understand the distinction between built-in locales and plugin language packs. I’m happy to leave #10604 open as a reference for the zh-TW contribution and revisit it once the language-pack authoring and synchronization workflow is ready. I won’t add further in-tree locale changes to this PR in the meantime.

If there is a tracking issue or design thread for the language-pack authoring work, please feel free to link it. I’d be glad to help validate the zh-TW catalog and Taiwan terminology against the eventual contract.

Thanks again for the transparency.

Map zh-TW/zh-HK/zh-Hant system locales to a dedicated Traditional Chinese
catalog instead of falling back to English or serving Simplified Chinese.
Prefer Taiwan terms (電腦/複製/儲存/權限/帳戶) over Mainland OpenCC
residue, and translate first-screen English fallbacks for workspace
connect, remote runtime reconnect, and the agent dashboard.

Residual: ~600 catalog strings still match English (product names,
Linear skill prompts, browser cert flows, deeper settings). Full
catalog polish is out of scope for this pass.
@innocarpe
innocarpe force-pushed the feat/zh-hant-ui-locale branch from d8e160f to c7f1723 Compare August 12, 2026 16:22
@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@innocarpe

Copy link
Copy Markdown
Contributor Author

Sync update (c7f17234c0)

Addressed the remaining Traditional Chinese localization review scope: translated the dashboard, browser certificate-error, and remote-agent detection fallbacks, and added regression coverage for the core review surfaces.\n\nValidation: 18 focused locale tests passed, full typecheck passed, Oxfmt passed, and Oxlint passed.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/renderer/src/i18n/zh-tw-core-localization.test.ts (1)

2-3: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

Cover the lazy-loading contract in a renderer test.

Direct JSON imports validate catalog content, but they bypass setRendererUiLanguage and the lazy backend. This test can pass if the zh-TW resource mapping or loader registration is broken. If no separate test covers UI_LANGUAGE_CHINESE_TRADITIONAL, add one that calls setRendererUiLanguage, asserts i18n.language is zh-TW, and checks a translated key after the promise resolves. Use src/renderer/src/i18n/lazy-locale.test.ts, Lines 29-33, as the pattern.

Also applies to: 25-34


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 28c7cabe-41a6-4c79-b6b6-2b565bac6022

📥 Commits

Reviewing files that changed from the base of the PR and between 09ec516 and c7f1723.

📒 Files selected for processing (15)
  • src/main/i18n/main-i18n.ts
  • src/renderer/src/components/settings/appearance-search.ts
  • src/renderer/src/i18n/i18n.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh-TW.json
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/i18n/supported-languages.ts
  • src/renderer/src/i18n/zh-tw-core-localization.test.ts
  • src/shared/ui-language.test.ts
  • src/shared/ui-language.ts
  • src/shared/ui-locale.test.ts
  • src/shared/ui-locale.ts
🚧 Files skipped from review as they are similar to previous changes (13)
  • src/renderer/src/i18n/locales/ja.json
  • src/main/i18n/main-i18n.ts
  • src/renderer/src/components/settings/appearance-search.ts
  • src/renderer/src/i18n/locales/es.json
  • src/shared/ui-language.test.ts
  • src/renderer/src/i18n/i18n.ts
  • src/shared/ui-locale.test.ts
  • src/renderer/src/i18n/supported-languages.ts
  • src/renderer/src/i18n/locales/en.json
  • src/shared/ui-locale.ts
  • src/shared/ui-language.ts
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Traditional Chinese (zh-Hant) UI locale

4 participants