Skip to content

feat(desktop): add i18n infrastructure with Chinese (zh-CN) support - #38136

Closed
Eddie0521 wants to merge 1 commit into
NousResearch:mainfrom
Eddie0521:feat/desktop-i18n
Closed

feat(desktop): add i18n infrastructure with Chinese (zh-CN) support#38136
Eddie0521 wants to merge 1 commit into
NousResearch:mainfrom
Eddie0521:feat/desktop-i18n

Conversation

@Eddie0521

Copy link
Copy Markdown

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-languagedetector dependencies
  • i18n init with system-language auto-detection, fallback to English
  • Language detection: navigator.language > localStorage override > English
  • Runtime locale switcher via setLocale() (persisted)
  • currentLocale() getter

Chinese 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 strings
  • gateway-connecting-overlay.tsx — animated CONNECTING text
  • updates-overlay.tsx — stage labels, available/manual/applying/error views
  • desktop-install-overlay.tsx — stage states, progress, error, log views
  • desktop-onboarding-overlay.tsx — ~75 strings: provider names, flow instructions, code block, confirming model panel

How 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)

- 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)
@Eddie0521
Eddie0521 requested a review from a team June 3, 2026 10:53
@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have labels Jun 3, 2026
@teknium1

teknium1 commented Jun 5, 2026

Copy link
Copy Markdown
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low — cosmetic, nice to have type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants