feat(i18n): add Traditional Chinese (zh-TW) language support#22
Merged
Merged
Conversation
Add 正體中文 (Traditional Chinese) as a new language option across all three platforms: web (Astro), Windows (TypeScript), and macOS (Swift). - Web: 349 translated entries in dict.ts, language switcher buttons, browser auto-detection for zh-TW/zh-HK/zh-MO locales - Windows: 220 translated entries in i18n.ts, localStorage and browser language detection - macOS: new zh-Hant.lproj/Localizable.strings with 334 entries Translations converted from existing Simplified Chinese using OpenCC s2twp (Simplified → Traditional with Taiwan phrases). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ntd4996
added a commit
that referenced
this pull request
Jun 16, 2026
Owner
|
Merged, thank you, 正體中文 support across web, Windows and macOS in one PR is great, and converting from Simplified via OpenCC s2twp was a smart approach. One small thing I added on top: the macOS side needed wiring into the language picker (a new |
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.
Summary
dict.ts, language switcher buttons (desktop dropdown + mobile segmented control), browser auto-detection forzh-TW/zh-HK/zh-MOlocales,HTML lang="zh-Hant"mappingi18n.ts, localStorage persistence and browser language detectionzh-Hant.lproj/Localizable.stringswith 334 entriesTranslations were converted from the existing Simplified Chinese entries using OpenCC with the
s2twpprofile (Simplified → Traditional with Taiwan phrase adjustments).Details
Language detection logic
navigator.languagevalueszh-TW,zh-HK,zh-MO, andzh-Hant*→ mapped tozh-TWzh-*values → mapped tozh(Simplified Chinese, unchanged)localStorageand restored on next visitFiles changed
web/src/i18n/dict.tsLangtype,LANGSarray,DICTRecord; added zh-TW translation blockweb/src/layouts/Base.astroLANGS/HTML_LANG/SHORT/detect()in inline JSwindows/src/i18n.tsLangtype; added zh-TW translation block and browser detectionLocalizations/zh-Hant.lproj/Localizable.stringsTest plan
zh-TWlocale auto-detects Traditional Chinese on first visitzh-HKlocale auto-detects Traditional Chinesezh-CNlocale still shows Simplified Chinese (unchanged)zh-Hant.lproj/Localizable.stringsrecognized by Xcode / Swift runtime🤖 Generated with Claude Code