Repository navigation
feat(i18n): add Traditional Chinese (zh-TW) locale - #287
Merged
Merged
Conversation
Register zh-TW and route zh-TW/zh-Hant/zh-HK/zh-MO to it. Switch i18next load to "currentOnly" because "languageOnly" collapses zh-TW to zh and would always serve Simplified Chinese.
cxymds
approved these changes
Nov 5, 2026
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.
Pull Request
Description
Add Traditional Chinese (
zh-TW) as a supported console locale.i18n/locales/zh-TW.json, aligned 1:1 withen-US.json(2315 keys, same order, all{placeholders}preserved, Taiwan terminology).zh-TWinLOCALE_FILE_MAP.zh-TW,zh_TW,zh-Hant,zh-Hant-TW,zh-HK,zh-MOresolve to it.zh,zh-CN,zh-Hans,zh-SGstill resolve to Simplified Chinese.loadoption from"languageOnly"to"currentOnly". WithlanguageOnly, i18next collapseszh-TWtozhand always serves Simplified Chinese. All other locale codes are already language-only, so they are unaffected.簡體中文and add繁體中文. Resolve the current locale withnormalizeLocale()instead ofsplit("-")[0].zhTWlocale forzh-TW.Type of Change
Testing
New tests:
tests/lib/i18n-config.test.js: Traditional Chinese variants resolve tozh-TW, Simplified variants stay onzh, andgetLocaleFile("zh-TW")returnszh-TW.tests/lib/datetime-picker.test.js:zh-TWmaps to the date-fnszh-TWlocale.Run on Node 22 and pnpm 12.3.4 in an LF checkout (same as CI):
Checklist
Related Issues
Closes #
Screenshots (if applicable)
Additional Notes
中文option is renamed to簡體中文so the two Chinese options can be told apart. Please confirm this is acceptable under the migration rule on page text changes.