Skip to content

feat(i18n): add internationalization support for Chinese and English#11

Merged
liruifengv merged 1 commit intomainfrom
feat/i18n
Feb 15, 2026
Merged

feat(i18n): add internationalization support for Chinese and English#11
liruifengv merged 1 commit intomainfrom
feat/i18n

Conversation

@liruifengv
Copy link
Copy Markdown
Owner

Summary

  • Add full i18n support using i18next + react-i18next, covering both renderer process (React UI) and main process (Electron menus, dialogs)
  • Create 18 translation JSON files across 9 namespaces (common, chat, message, settings, sidebar, permission, onboarding, menu, validation) for English and Chinese
  • Replace ~200 hardcoded UI strings across ~30 component files with t() calls
  • Add language selector in General Settings with real-time switching, synced across all windows

Changes

  • Dependencies: i18next, react-i18next, zod-i18n-map
  • New files: src/renderer/i18n.ts, src/main/i18n.ts, src/locales/{en,zh}/*.json
  • Modified: 45 existing files (components, stores, schemas, main process)
  • Settings: Added language field to SettingsSchema (default: 'en')

Test plan

  • Default English: all UI text displays in English on fresh start
  • Switch to Chinese: all UI text updates immediately
  • Switch back to English: all UI text updates immediately
  • Electron menu bar follows language setting
  • Native dialogs (file picker, confirm) follow language setting
  • Language persists after app restart
  • Both windows (main + settings) stay in sync
  • Old settings.json without language field upgrades gracefully

🤖 Generated with Claude Code

- Install i18next, react-i18next, zod-i18n-map
- Create 18 translation JSON files (9 namespaces × 2 languages)
- Add i18n initialization for renderer (react-i18next) and main process (standalone instance)
- Extend SettingsSchema with language field (default: 'en')
- Add language selector in General Settings with real-time switching
- Replace ~200 hardcoded UI strings across ~30 component files with t() calls
- Internationalize Electron menus and native dialogs
- Sync language across main process, both renderer windows via settings:changed IPC

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@liruifengv liruifengv merged commit c2fa99d into main Feb 15, 2026
@liruifengv liruifengv deleted the feat/i18n branch February 15, 2026 05:19
@github-actions github-actions bot mentioned this pull request Feb 15, 2026
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