feat(i18n): add Traditional Chinese (zh-TW) locale support#1131
feat(i18n): add Traditional Chinese (zh-TW) locale support#1131Celina-create wants to merge 1 commit intomainfrom
Conversation
Add full Traditional Chinese (繁體中文) support to the client UI. - Create `zh-TW.ts` translation file (converted from zh-CN via OpenCC s2twp) - Register zh-TW resource in i18next init - Extend Locale type to include "zh-TW" - Auto-detect zh-TW/zh-HK browser locale - Add "繁體中文" option to language switcher and settings page - Update desktop renderer i18n helper with zh-TW fallback Closes #1120 Made-with: Cursor
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a0534676b1
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| const apiLocaleMap: Record<Locale, string> = { | ||
| en: "en", | ||
| zh: "zh-CN", | ||
| "zh-TW": "zh-TW", | ||
| }; |
There was a problem hiding this comment.
Align zh-TW locale sync with desktop API contract
When a user picks Traditional Chinese, syncDesktopLocale() now sends "zh-TW" to /api/internal/desktop/preferences, but the controller route still validates locale as only "en" | "zh-CN" (apps/controller/src/routes/desktop-routes.ts, checked desktopPreferencesUpdateSchema). That request is rejected (400) and then swallowed by .catch, so the UI appears to switch but desktop preferences never persist server-side and controller/runtime features that rely on stored locale remain out of sync.
Useful? React with 👍 / 👎.
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
Summary
Add full Traditional Chinese (繁體中文) UI support to the Nexu client, as requested in #1120.
apps/web/src/i18n/locales/zh-TW.ts— all 1190+ translation keys converted from Simplified Chinese via OpenCC s2twp (Taiwan-standard phrases)zh-TWresource added alongside existingenandzhnavigator.languageofzh-TWorzh-HKauto-selects Traditional ChineseresolveLocale()helper updated with optionalzh-TWkey support and fallback tozhsyncDesktopLocale()andbootstrapLocale()properly handlezh-TWround-tripChanged files
apps/web/src/i18n/locales/zh-TW.tsapps/web/src/i18n/index.tsapps/web/src/hooks/use-locale.tsxLocaletype, detection, sync, bootstrapapps/web/src/components/language-switcher.tsxapps/web/src/pages/models.tsxapps/desktop/src/lib/i18n.tsCloses #1120
Test plan
zh-TWlocale auto-detects Traditional Chinese on first loadzh-HKlocale also auto-detects Traditional ChineseMade with Cursor