Skip to content

feat: add i18n to web dashboard — English + Chinese language switcher#9453

Merged
teknium1 merged 1 commit into
mainfrom
hermes/hermes-c0821fe8
Apr 14, 2026
Merged

feat: add i18n to web dashboard — English + Chinese language switcher#9453
teknium1 merged 1 commit into
mainfrom
hermes/hermes-c0821fe8

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Summary

Adds internationalization to the web dashboard with English (default) and Chinese language support. A flag-based language switcher in the header lets users toggle between languages; the choice persists to localStorage.

What changed

New files:

  • web/src/i18n/ — lightweight i18n system (types, English + Chinese translation files, React context/hook)
  • web/src/components/LanguageSwitcher.tsx — compact flag toggle in the header bar

Modified files:

  • web/src/main.tsx — wraps App in I18nProvider
  • web/src/App.tsx — nav labels use translations, language switcher added to header
  • All 8 pages (StatusPage, SessionsPage, AnalyticsPage, LogsPage, CronPage, SkillsPage, ConfigPage, EnvPage) — all hardcoded strings replaced with t() translation calls
  • OAuthProvidersCard.tsx + OAuthLoginModal.tsx — OAuth UI strings translated

Design decisions

  • Zero new dependencies — pure React context + localStorage. No react-i18next or similar; overkill for 2 languages.
  • Type-safeTranslations interface ensures both language files have identical structure. TypeScript catches missing keys.
  • Switcher shows the other language's flag — clicking the Chinese flag switches to Chinese, clicking the UK flag switches back to English. Label text shows the target language name.
  • Template strings use {placeholder} syntax with simple .replace() — no runtime template engine needed.

How it looks

The language switcher sits in the header between the nav tabs and the "Web UI" label. On mobile it's just the flag icon; on desktop it shows the flag + target language abbreviation.

Build verification

npx tsc -b        # ✓ clean
npx vite build    # ✓ 342 KB gzipped to 103 KB

…inese

Add a lightweight i18n system to the web dashboard with English (default) and
Chinese language support. A language switcher with flag icons is placed in the
header bar, allowing users to toggle between languages. The choice persists
to localStorage.

Implementation:
- src/i18n/ — types, translation files (en.ts, zh.ts), React context + hook
- LanguageSwitcher component shows the *other* language's flag as the toggle
- I18nProvider wraps the app in main.tsx
- All 8 pages + OAuth components updated to use t() translation calls
- Zero new dependencies — pure React context + localStorage
@teknium1 teknium1 force-pushed the hermes/hermes-c0821fe8 branch from 3afc9a8 to 097ed50 Compare April 14, 2026 06:17
@teknium1 teknium1 merged commit a2ea237 into main Apr 14, 2026
3 of 4 checks passed
@teknium1 teknium1 deleted the hermes/hermes-c0821fe8 branch April 14, 2026 06:19
ulasbilgen pushed a commit to ulasbilgen/hermes-adhd-agent that referenced this pull request May 1, 2026
…inese (NousResearch#9453)

Add a lightweight i18n system to the web dashboard with English (default) and
Chinese language support. A language switcher with flag icons is placed in the
header bar, allowing users to toggle between languages. The choice persists
to localStorage.

Implementation:
- src/i18n/ — types, translation files (en.ts, zh.ts), React context + hook
- LanguageSwitcher component shows the *other* language's flag as the toggle
- I18nProvider wraps the app in main.tsx
- All 8 pages + OAuth components updated to use t() translation calls
- Zero new dependencies — pure React context + localStorage
aj-nt pushed a commit to aj-nt/hermes-agent that referenced this pull request May 1, 2026
…inese (NousResearch#9453)

Add a lightweight i18n system to the web dashboard with English (default) and
Chinese language support. A language switcher with flag icons is placed in the
header bar, allowing users to toggle between languages. The choice persists
to localStorage.

Implementation:
- src/i18n/ — types, translation files (en.ts, zh.ts), React context + hook
- LanguageSwitcher component shows the *other* language's flag as the toggle
- I18nProvider wraps the app in main.tsx
- All 8 pages + OAuth components updated to use t() translation calls
- Zero new dependencies — pure React context + localStorage
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 2026
…inese (NousResearch#9453)

Add a lightweight i18n system to the web dashboard with English (default) and
Chinese language support. A language switcher with flag icons is placed in the
header bar, allowing users to toggle between languages. The choice persists
to localStorage.

Implementation:
- src/i18n/ — types, translation files (en.ts, zh.ts), React context + hook
- LanguageSwitcher component shows the *other* language's flag as the toggle
- I18nProvider wraps the app in main.tsx
- All 8 pages + OAuth components updated to use t() translation calls
- Zero new dependencies — pure React context + localStorage
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
…inese (NousResearch#9453)

Add a lightweight i18n system to the web dashboard with English (default) and
Chinese language support. A language switcher with flag icons is placed in the
header bar, allowing users to toggle between languages. The choice persists
to localStorage.

Implementation:
- src/i18n/ — types, translation files (en.ts, zh.ts), React context + hook
- LanguageSwitcher component shows the *other* language's flag as the toggle
- I18nProvider wraps the app in main.tsx
- All 8 pages + OAuth components updated to use t() translation calls
- Zero new dependencies — pure React context + localStorage
Egavasyug pushed a commit to Egavasyug/hermes-agent that referenced this pull request Jun 10, 2026
…inese (NousResearch#9453)

Add a lightweight i18n system to the web dashboard with English (default) and
Chinese language support. A language switcher with flag icons is placed in the
header bar, allowing users to toggle between languages. The choice persists
to localStorage.

Implementation:
- src/i18n/ — types, translation files (en.ts, zh.ts), React context + hook
- LanguageSwitcher component shows the *other* language's flag as the toggle
- I18nProvider wraps the app in main.tsx
- All 8 pages + OAuth components updated to use t() translation calls
- Zero new dependencies — pure React context + localStorage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant