Repository navigation
feat(i18n): add Traditional Chinese (zh-TW) - #542
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #542 +/- ##
=======================================
Coverage 71.88% 71.89%
=======================================
Files 168 169 +1
Lines 29729 29734 +5
Branches 1477 1479 +2
=======================================
+ Hits 21372 21376 +4
Misses 7908 7908
- Partials 449 450 +1
🚀 New features to boost your workflow:
|
Member
|
nice work @monarchsofchaos004-gif ,thanks for contribution! |
Blankll
added a commit
that referenced
this pull request
Nov 13, 2026
Follow-up on the review of #542 (zh-TW). ## Fix: language choice was never persisted `getStoredLocale()` read `localStorage['lang']`, which nothing in the codebase ever wrote — so a language picked in settings silently reverted to OS auto-detection on the next launch. This was pre-existing (affected zhCN too); for zh-TW users it was masked because auto-detection now happens to resolve to `zhTW`. `getStoredLocale()` now: 1. validates the `lang` value (previously cast unchecked), 2. falls back to the pinia-persisted `app.languageType` (pinia-plugin-persistedstate default key = store id, verified from the plugin source), so **existing users' past choices take effect retroactively** — no picker change needed, 3. degrades gracefully to auto-detection on a corrupted blob. ## Tests - `tests/lang/zhTW.test.ts` merged into `tests/lang/parity.test.ts`: key parity + placeholder checks are now parametrized over `zhCN` / `zhTW`, and both get **two-direction** assertions (en→locale and locale→en no-extra-keys) — stronger than the previous zhCN one-direction check. Adding a future locale is one array entry. - `tests/lang/index.test.ts` extended with the behavior #542 introduced but didn't cover: `it.each` over `zh-TW` / `zh-Hant-TW` / `zh-Hant` / `zh-HK` / `zh-MO` → cn, bare `zh` / `en-US` → en, plus the three persistence-fallback paths (valid `zhTW`, invalid value, corrupted JSON). ## Verification - `npx jest` — 70 suites / 1983 tests pass - `npx tsc --noEmit` — clean - `npx eslint` on changed files — clean
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.
Adds a Traditional Chinese (Taiwan) UI translation, as discussed in #540.
tests/lang/zhTW.test.ts) so new English strings can't silently drift from this file.Closes #540