feat(desktop): extend Simplified Chinese (zh-CN) i18n coverage - #187
Merged
Conversation
…, inspector, approval card, sidebar, and settings Expand the existing react-i18next infrastructure to cover the high-visibility UI surfaces that were still hardcoded in English: - Thread header: trust state, paper/fork actions, review panel toggle - Goal rail: all CRUD labels, status text, editor form - Approval card: action buttons, detail text, aria labels - Inspector: tab labels, aria landmarks - Sidebar: empty states, session counts, footer status - Settings: updates card, diagnostics card - Runtime notice: offline state, restart action The locale auto-detection (navigator.language) and manual override (Settings → Language) already work; this commit adds the Chinese strings those paths need. Also resets the i18n language in the App test beforeEach to prevent state leaks between tests now that more components consume the translation context.
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.
Description
Extends the existing
react-i18nextinfrastructure to cover the high-visibility Desktop UI surfaces that were still hardcoded in English. After this change, switching to 简体中文 in Settings → Language translates the majority of user-facing strings across the entire application shell.Closes #154
Changes Made
New zh-CN translations added (~80 keys) covering:
Pattern used — matches the existing convention established in
6bf21972:defaultValueat each call sitezh-CNresource table ini18n.tscarries translationsnavigator.language) + manual override in SettingsTest stability fix: Added
__setLocaleForTests("en")toApp.test.tsxbeforeEachto prevent i18n state leaks between tests now that more components consume the translation context.How It Looks
When the user switches to 简体中文:
Checklist
tsc --noEmit+vitest run— 194/194 pass)eslint .— 0 errors, 0 warnings)Additional Notes
This PR focuses on coverage breadth — translating the strings users see most often. The
i18n.tsarchitecture already supports adding more locales (zh-TW, ja, etc.) by adding another resource object. The inlinedefaultValuepattern means untranslated keys always fall back to readable English.