feat(client): add Traditional Chinese (zh-TW) language support#612
Open
WeilJimmer wants to merge 2 commits intoEKKOLearnAI:mainfrom
Open
feat(client): add Traditional Chinese (zh-TW) language support#612WeilJimmer wants to merge 2 commits intoEKKOLearnAI:mainfrom
WeilJimmer wants to merge 2 commits intoEKKOLearnAI:mainfrom
Conversation
Update language switcher and i18n configuration to include Traditional Chinese. Modify locale resolution to prioritize exact matches (zh-TW) over base codes (zh), ensuring accurate browser language detection. Add complete translation set. Co-authored-by: Copilot <copilot@github.com>
There was a problem hiding this comment.
Pull request overview
Adds Traditional Chinese (zh-TW) support to the client i18n system, including a full translation set and updated locale selection logic intended to prefer exact locale matches over base language codes.
Changes:
- Added
zh-TWlocale messages and registered them in the i18n message map. - Extended supported locale list and updated locale resolution to check full BCP-47 tags before falling back to 2-letter language codes.
- Updated the language switcher UI to expose both Simplified Chinese (
zh) and Traditional Chinese (zh-TW).
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/client/src/i18n/messages.ts | Registers zh-TW messages and includes them in the merged runtime message set. |
| packages/client/src/i18n/locales/zh-TW.ts | Adds the full Traditional Chinese translation dictionary. |
| packages/client/src/i18n/index.ts | Extends supported locales and adjusts browser locale detection to prefer exact matches. |
| packages/client/src/components/layout/LanguageSwitch.vue | Adds a zh-TW option and distinguishes Simplified vs Traditional Chinese labels. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Refactor resolveLocale to use a normalize helper that correctly maps BCP-47 tags to supported locale keys, properly distinguishing Traditional vs Simplified Chinese variants. Additionally, iterate over navigator.languages instead of relying solely on navigator.language to respect the browser's full language preference list. Co-authored-by: Copilot <copilot@github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Update language switcher and i18n configuration to include Traditional Chinese. Modify locale resolution to prioritize exact matches (zh-TW) over base codes (zh), ensuring accurate browser language detection. Add complete translation set.