Add zh-TW (Traditional Chinese) interface locale - #4
Open
eugenetwtw wants to merge 11 commits into
Open
Conversation
Add support for Traditional Chinese localization by reusing Simplified Chinese text.
Add support for Traditional Chinese (Taiwan) in response language.
Added support for Traditional Chinese locale in QuestionCopyLocale type and resolutionQuestionCopy function.
Updated the README to include Traditional Chinese in the localized visual tutorial and UI language support.
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.
Outcome
Traditional Chinese users currently have to pick between Simplified Chinese and English, and because
DEFAULT_UI_LOCALEiszh-CNthey also land on Simplified by default. The gap is not only orthographic: the vocabulary differs (幻灯片/投影片, 模板/範本, 项目/專案, 导出/匯出), so Simplified copy reads as a foreign product rather than a translated one. This adds 繁體中文 as a fourth interface locale.Changes
src/i18n/types.ts,src/i18n/messages.ts: registerzh-TWinLocale,LOCALES,LOCALE_LABEL, andDICTS.src/i18n/locales/zh-TW.ts: new dictionary covering all 977 keys.src/components/GlobalSettings.tsx: 繁 badge for the new option. zh-CN moves from the generic 文 to 简, since with two Chinese entries the generic glyph is ambiguous — happy to revert that one character if you prefer a minimal diff.src/lib/templates.ts,src/lib/scenarios.ts: resolvezh-TWto the Chinese copy instead of falling through to English.src/lib/onboard.ts: ask the agent for "Traditional Chinese (Taiwan)" so generated decks and speaker notes are not Simplified.src/lib/questionSemantics.ts: widenQuestionCopyLocale(required —onboard.tspasses aUiLocaleinto it) and add the render-quality fallback copy.mcp/server.mjs: addzh-TWto the three locale enums so Browser, CLI, and MCP stay one contract.README.md,CONTRIBUTING.md: document the fourth locale and the new dictionary file.On the translation itself: it is derived from
zh-CN.tsby transforming the values programmatically — a Taiwan terminology layer first (投影片, 範本, 專案, 匯出, 儲存, 介面, 預設, 螢幕, 使用者, 資料, 訊息, 程式碼, 簡報 …), then character conversion — so keys, ordering, and{{placeholder}}tokens are preserved by construction rather than by hand.Verification
This branch was authored through the GitHub web editor, so I have not been able to run the local gates. I have left the checklist unchecked rather than imply otherwise:
What I did verify mechanically against the committed files, by replicating the dictionary logic in
scripts/check-i18n.mjs:LOCALESparses toen, zh-CN, zh-TW, ja; each locale file contains exactly the 977 English keys with 0 missing, 0 extra, and 0 duplicates;{{placeholder}}sets match English for every key in all four locales; and no Simplified-only character remains inzh-TW.ts. I can see the repo has no pull-request CI workflow, so these will not run automatically. I will run the full gate list on a local checkout and report the output in this thread before you spend review time on it; if anything fails I will push fixes here.Visual evidence
None yet. I could not run the app locally for this change and would rather not attach a mocked screenshot. The only new UI surface is the existing Settings → Interface language list, which gains a fourth row (繁 繁體中文). Glad to add real screenshots if you want them before merge.
Risks and compatibility
Additive and backward compatible:
DEFAULT_UI_LOCALEstayszh-CNand previously stored locale values remain valid. Existing installs should restart Codex or reinstall the plugin so cached Skill/MCP metadata picks up the widened locale enum.Known limitations and open questions:
zh-TW— readable, but not localized. Would you like azh-TWfield onLocalizedScenarioTextas a follow-up?src/app/layout.tsxstill hardcodeslang="zh-CN"on<html>. That affects every locale, so it felt out of scope here.