Skip to content

feat(i18n): add full Traditional Chinese (zh-TW) UI support#259

Merged
H-Chris233 merged 1 commit into
Open-Less:mainfrom
H-Chris233:main
May 5, 2026
Merged

feat(i18n): add full Traditional Chinese (zh-TW) UI support#259
H-Chris233 merged 1 commit into
Open-Less:mainfrom
H-Chris233:main

Conversation

@H-Chris233
Copy link
Copy Markdown
Collaborator

@H-Chris233 H-Chris233 commented May 5, 2026

User description

Summary

  • Add full zh-TW locale resource file for Traditional Chinese UI
  • Wire zh-TW into i18n supported locales, resource registration, persisted preference, and system locale detection
  • Add Traditional Chinese option in both language selectors (Settings page + Settings modal)
  • Add type-level shape lock for zh-TW (typeof zhCN) to avoid future key drift

Verification

  • npm run -s build (in openless-all/app)

Scope

  • Minimal changes, limited to i18n and language selection UI

PR Type

Enhancement


Description

  • Add full Traditional Chinese (zh-TW) locale resource file

  • Register zh-TW in i18n system, storage, and system detection

  • Extend system locale detection to map zh-Hant/TW/HK/MO to zh-TW

  • Add Traditional Chinese option in both language selectors


Diagram Walkthrough

flowchart LR
  A["Create zh-TW.ts locale file"] --> B["Register in i18n/index.ts"]
  B --> C["Update SUPPORTED_LOCALES and resources"]
  B --> D["Enhance system locale detection for zh-TW"]
  C --> E["Add language option in Settings.tsx"]
  D --> E
  C --> F["Add language option in SettingsModal.tsx"]
Loading

File Walkthrough

Relevant files
Enhancement
zh-TW.ts
Add Traditional Chinese locale resource file                         

openless-all/app/src/i18n/zh-TW.ts

  • Added complete Traditional Chinese locale file (515 lines)
  • Typed as typeof zhCN to lock key shape and prevent future drift
+515/-0 
index.ts
Integrate zh-TW into i18n system                                                 

openless-all/app/src/i18n/index.ts

  • Imported zhTW module
  • Added 'zh-TW' to SUPPORTED_LOCALES
  • Updated detectSystemLocale() to return 'zh-TW' for zh-Hant/TW/HK/MO
  • Updated getStoredLocale() to accept 'zh-TW'
  • Registered 'zh-TW' translation resource in i18next
+8/-3     
en.ts
Add Traditional Chinese label in English locale                   

openless-all/app/src/i18n/en.ts

  • Added zhTW: '繁體中文' under settings.language
+1/-0     
zh-CN.ts
Add Traditional Chinese label in Simplified Chinese locale

openless-all/app/src/i18n/zh-CN.ts

  • Added zhTW: '繁體中文' under settings.language
+1/-0     
SettingsModal.tsx
Add Traditional Chinese option in Settings modal picker   

openless-all/app/src/components/SettingsModal.tsx

  • Added with t('settings.language.zhTW') in the
    language selector
+1/-0     
Settings.tsx
Add Traditional Chinese option in Settings page picker     

openless-all/app/src/pages/Settings.tsx

  • Added with t('settings.language.zhTW') in the
    LanguageSection select
+1/-0     

Add zh-TW locale resources and wire it through language selection,
persistence, and system-locale detection. Also add static shape typing
for zh-TW to prevent future key drift from zh-CN.

Constraint: Keep changes minimal and localized to i18n + language pickers
Rejected: Partial zh-TW translation only for language section | fails full locale support goal
Confidence: high
Scope-risk: narrow
Reversibility: clean
Directive: Keep zh-TW key shape locked to zh-CN when adding new translation keys
Tested: npm run -s build (openless-all/app)
Not-tested: Manual runtime walkthrough on all platform shells
@chatgpt-codex-connector
Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 5, 2026

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ No major issues detected

@H-Chris233 H-Chris233 merged commit c5aa3fe into Open-Less:main May 5, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant