orca icon indicating copy to clipboard operation
orca copied to clipboard

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

Open innocarpe opened this issue 4 months ago • 4 comments

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

  • [x] 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.

innocarpe avatar Jul 25 '26 19:07 innocarpe

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[bot] avatar Jul 25 '26 19:07 coderabbitai[bot]

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).

  • Commit: d8e160f5e7e6781dcc761d0fdd0fde4fc053d7ef
  • Upstream: https://github.com/stablyai/orca/pull/10604
  • Fork portfolio: https://github.com/innocarpe/orca/pull/83

innocarpe avatar Jul 26 '26 03:07 innocarpe

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 avatar Aug 04 '26 09:08 nwparker

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.

nwparker avatar Aug 04 '26 09:08 nwparker

@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.

innocarpe avatar Aug 05 '26 02:08 innocarpe

[!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.

coderabbitai[bot] avatar Aug 12 '26 16:08 coderabbitai[bot]

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.

  • Commit: c7f17234c0b16098f58078d81e8846e89d334f4c
  • Upstream: https://github.com/stablyai/orca/pull/10604
  • Fork portfolio: https://github.com/innocarpe/orca/pull/83

innocarpe avatar Aug 12 '26 16:08 innocarpe

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 src/renderer/src/i18n/locales/zh-Hant.json (glossary in config/i18n-traditional-chinese.md) would be very welcome.

OrcaWin avatar Oct 28 '26 06:10 OrcaWin