Skip to content

feat(desktop): add i18n with Simplified Chinese (zh-Hans) support#38241

Merged
teknium1 merged 2 commits into
NousResearch:mainfrom
JimLiu:feat/desktop-zh-hans-i18n
Jun 5, 2026
Merged

feat(desktop): add i18n with Simplified Chinese (zh-Hans) support#38241
teknium1 merged 2 commits into
NousResearch:mainfrom
JimLiu:feat/desktop-zh-hans-i18n

Conversation

@JimLiu

@JimLiu JimLiu commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a lightweight i18n layer to the desktop app and a full Simplified Chinese (简体中文) translation. English remains the default; users can switch language from Appearance settings, and the choice is persisted to Hermes config (display.language).

Hermes Desktop main interface in Simplified Chinese Hermes Desktop language settings in Simplified Chinese

What's included

  • New apps/desktop/src/i18n module
    • types.ts — a typed Translations interface (single source of truth for all UI strings)
    • en.ts / zh.ts — English and Simplified Chinese locale tables
    • catalog.ts / languages.ts / runtime.ts — shared locale catalog, language metadata, and non-React translation helper
    • context.tsxI18nProvider + useI18n(), reads and persists language through desktop config (display.language), defaults to en; language endonyms for the picker (no flags — languages aren't countries)
    • context.test.tsx, languages.test.ts, runtime.test.ts — focused coverage for provider behavior, language metadata, and fallback translation lookup
  • main.tsx — wires I18nProvider at the app root
  • Desktop UI surfaces refactored to read strings from t / translateNow() instead of hard-coded English, including chat, sidebar, settings, command center, cron, messaging, profiles, skills, agents, artifacts, titlebar, boot, notifications, and update status text

Notes

  • Purely additive for English users: with the default locale unchanged, the UI renders the same strings as before.
  • The Translations interface makes adding further languages a matter of supplying one more locale table.
  • Non-React store messages now use the same catalog so boot, notification, and update text stay aligned with the selected language.

Test plan

  • npm run test:ui -- i18n
  • npm run test:ui -- src/store/updates.test.ts
  • npm run type-check
  • Targeted ESLint for touched desktop i18n/store/UI files
  • Launch desktop with display.language: zh; capture the main interface and language settings screenshots above

Infographic

desktop-i18n

@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have labels Jun 3, 2026

@tonydwb tonydwb left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review of PR #38241: feat(desktop): add i18n with Simplified Chinese (zh-Hans) support

Issues

  • Found secret pattern in diff; double-check.

Reviewed by Hermes Agent

@JimLiu JimLiu force-pushed the feat/desktop-zh-hans-i18n branch 6 times, most recently from 59f76c9 to 43be21d Compare June 4, 2026 15:34

JimLiu commented Jun 4, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for flagging this. I double-checked the current PR diff after the rebase.

The secret-pattern matches are false positives: the added strings are UI copy and configuration field names/placeholders such as TELEGRAM_BOT_TOKEN, DISCORD_BOT_TOKEN, SLACK_BOT_TOKEN, SLACK_APP_TOKEN, MATTERMOST_TOKEN, MATRIX_ACCESS_TOKEN, and wording like "Client Secret" in setup instructions. They are not actual credential values.

I also scanned the current PR diff for common token formats and high-entropy credential-looking values, and did not find any real secrets.

@JimLiu JimLiu force-pushed the feat/desktop-zh-hans-i18n branch from 43be21d to a734085 Compare June 4, 2026 18:47
JimLiu added 2 commits June 4, 2026 22:38
Introduce a lightweight React context-based i18n layer for the desktop
app and translate the UI into Simplified Chinese.

- New apps/desktop/src/i18n module: typed Translations interface, en + zh
  locale tables, I18nProvider/useI18n, localStorage-persisted locale
  (defaults to English), and language endonym metadata for the picker.
- Wire I18nProvider at the app root in main.tsx.
- Refactor 24 desktop screens/components to read strings from the `t`
  object instead of hard-coded English.
- Add a unit test for the i18n context.
@JimLiu JimLiu force-pushed the feat/desktop-zh-hans-i18n branch from 85b6023 to 705e4c4 Compare June 5, 2026 03:45
@teknium1 teknium1 merged commit 1d9c3eb into NousResearch:main Jun 5, 2026
20 checks passed
xyshanren pushed a commit to xyshanren/hermes-agent-cn that referenced this pull request Jun 12, 2026
…0+cn.6

v0.15.0+cn.5 backlog listed 'i18n upgrade (C8 19 commits)' as a
v0.15.0+cn.6 task. Re-evaluating against the actual commit reveals
the PR is 1 commit (4a1907b) and only modifies apps/desktop/
(upstream's Electron desktop app), which CN does not maintain
(Desktop = CN jian-fa T3 category).

Since v0.15.0+cn.5 already skipped NousResearch#38241 via EXCLUDE_LARGE /
timeout, no functional gap exists. Cherry-picking would add 4.2k
lines of desktop-only code with zero CN value and negative
maintenance cost.

This commit:
- Corrects the v0.15.0+cn.6 backlog (4 items -> 3 items)
- Documents the EXCLUDE rationale in CHANGELOG_CN.md
- Establishes upstream-merge-cn6-2026-06 as the v0.15.0+cn.6
  work branch (forked from cn @ 8ffd33a)
- Marks the original v0.15.0+cn.6 plan (i18n/T3/jian-fa/manual
  conflicts) as the real backlog

Refs: PLAN_CN.md, UPSTREAM_CLASSIFICATION_REPORT.md
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.

4 participants