Skip to content

feat(i18n): add Traditional Chinese (zh-TW) locale support#1131

Closed
Celina-create wants to merge 1 commit intomainfrom
feat/i18n-zh-tw
Closed

feat(i18n): add Traditional Chinese (zh-TW) locale support#1131
Celina-create wants to merge 1 commit intomainfrom
feat/i18n-zh-tw

Conversation

@Celina-create
Copy link
Copy Markdown
Contributor

Summary

Add full Traditional Chinese (繁體中文) UI support to the Nexu client, as requested in #1120.

  • New locale file: apps/web/src/i18n/locales/zh-TW.ts — all 1190+ translation keys converted from Simplified Chinese via OpenCC s2twp (Taiwan-standard phrases)
  • i18next registration: zh-TW resource added alongside existing en and zh
  • Locale detection: Browser navigator.language of zh-TW or zh-HK auto-selects Traditional Chinese
  • Language switcher: Both the Welcome page dropdown and Settings page selector now show three options: English / 简体中文 / 繁體中文
  • Desktop renderer: resolveLocale() helper updated with optional zh-TW key support and fallback to zh
  • Desktop sync: syncDesktopLocale() and bootstrapLocale() properly handle zh-TW round-trip

Changed files

File Change
apps/web/src/i18n/locales/zh-TW.ts New — full Traditional Chinese translation
apps/web/src/i18n/index.ts Register zh-TW resource, update detection
apps/web/src/hooks/use-locale.tsx Extend Locale type, detection, sync, bootstrap
apps/web/src/components/language-switcher.tsx Add 繁體中文 option
apps/web/src/pages/models.tsx Add 繁體中文 to settings language selector
apps/desktop/src/lib/i18n.ts Support zh-TW in desktop renderer helper

Closes #1120

Test plan

  • Switch language to 繁體中文 in Welcome page language switcher — UI strings display in Traditional Chinese
  • Switch language to 繁體中文 in Settings → General → Language — UI strings update correctly
  • Verify browser with zh-TW locale auto-detects Traditional Chinese on first load
  • Verify browser with zh-HK locale also auto-detects Traditional Chinese
  • Switch between English → 简体中文 → 繁體中文 and back — no rendering issues
  • Refresh page after selecting 繁體中文 — locale persists via localStorage
  • Verify desktop app renderer picks up zh-TW when available

Made with Cursor

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
@Celina-create Celina-create deleted the feat/i18n-zh-tw branch April 15, 2026 14:53
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 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".

Comment on lines +103 to +107
const apiLocaleMap: Record<Locale, string> = {
en: "en",
zh: "zh-CN",
"zh-TW": "zh-TW",
};
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

@sentry
Copy link
Copy Markdown

sentry Bot commented Apr 15, 2026

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

希望支持繁体中文客户端

1 participant