feat(desktop): add i18n infrastructure with Chinese (zh-CN) support - #38136
Closed
Eddie0521 wants to merge 1 commit into
Closed
feat(desktop): add i18n infrastructure with Chinese (zh-CN) support#38136Eddie0521 wants to merge 1 commit into
Eddie0521 wants to merge 1 commit into
Conversation
- Add react-i18next + i18next + i18next-browser-languagedetector deps - Create i18n init with system-language auto-detect, fallback to en - Create comprehensive zh-CN translation file (~150 strings) - Wire i18n into main.tsx Migrate overlays to use react-i18next translations: - boot-failure-overlay.tsx (all strings) - gateway-connecting-overlay.tsx (animated CONNECTING text) - updates-overlay.tsx (all strings, stage labels via i18n.t()) - desktop-install-overlay.tsx (all strings, stage states, progress) - desktop-onboarding-overlay.tsx (~75 strings across sub-components)
Contributor
|
Superseded by #38241, which we merged as the desktop i18n foundation + Simplified Chinese translation. It aligns with our existing web/src/i18n pattern (typed Translations, I18nProvider/useI18n, display.language config key), was already green across CI, and merged cleanly. Thanks for the work on localization — this is exactly the direction we wanted, and your effort helped confirm it. #38241 |
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
Add internationalization (i18n) support to the Hermes Desktop app with a complete Chinese (zh-CN) translation.
What was added
Infrastructure (
apps/desktop/src/i18n/):react-i18next+i18next+i18next-browser-languagedetectordependenciesnavigator.language> localStorage override > EnglishsetLocale()(persisted)currentLocale()getterChinese translation (
locales/zh-CN/translation.json):~150 translated strings covering the 5 first-launch + update overlays
Migrated components (5 overlays fully migrated):
boot-failure-overlay.tsx— all recovery UI stringsgateway-connecting-overlay.tsx— animated CONNECTING textupdates-overlay.tsx— stage labels, available/manual/applying/error viewsdesktop-install-overlay.tsx— stage states, progress, error, log viewsdesktop-onboarding-overlay.tsx— ~75 strings: provider names, flow instructions, code block, confirming model panelHow it works
Users with Chinese system locale see Chinese UI automatically. Users can switch at runtime (via a future settings panel). Adding more languages requires only adding a new locale JSON file.
Testing
npm run type-check✅npm run lint✅ (0 new errors)