Skip to content

feat(desktop): extend Simplified Chinese (zh-CN) i18n coverage - #187

Merged
Zongwei9888 merged 1 commit into
HKUDS:mainfrom
rifkir23:feat/i18n-zh-cn
Aug 28, 2026
Merged

feat(desktop): extend Simplified Chinese (zh-CN) i18n coverage#187
Zongwei9888 merged 1 commit into
HKUDS:mainfrom
rifkir23:feat/i18n-zh-cn

Conversation

@rifkir23

Copy link
Copy Markdown
Contributor

Description

Extends the existing react-i18next infrastructure to cover the high-visibility Desktop UI surfaces that were still hardcoded in English. After this change, switching to 简体中文 in Settings → Language translates the majority of user-facing strings across the entire application shell.

Closes #154

Changes Made

New zh-CN translations added (~80 keys) covering:

Surface Translated Strings
Thread header Trust state, Paper/Fork actions, Review panel toggle
Goal rail All CRUD labels, status text, editor form fields
Approval card Allow/Deny buttons, detail text, aria labels
Inspector panel Tab labels (changes, files, artifacts, tests, terminal, details), landmarks
Sidebar Empty states, session counts, Show more/less, footer status
Settings: Updates Check/install labels, status messages
Settings: Diagnostics Export, run checks, section headers
Runtime notice Offline state, restart action

Pattern used — matches the existing convention established in 6bf21972:

  • English is the source of truth via defaultValue at each call site
  • zh-CN resource table in i18n.ts carries translations
  • System language auto-detection (navigator.language) + manual override in Settings

Test stability fix: Added __setLocaleForTests("en") to App.test.tsx beforeEach to prevent i18n state leaks between tests now that more components consume the translation context.

How It Looks

When the user switches to 简体中文:

  • Sidebar: 会话, 自动化, 技能, 插件, 设置, 新建会话, 本地智能体就绪
  • Thread header: 信任文件夹, 已信任, 审查, 分叉, 论文
  • Goal rail: 设定目标, 编辑目标, 暂停, 恢复, 清除目标
  • Approval: 允许一次, 允许本次会话, 拒绝
  • Inspector tabs: 变更, 文件, 产物, 测试, 终端, 详情

Checklist

  • Changes tested locally (tsc --noEmit + vitest run — 194/194 pass)
  • Lint passes (eslint . — 0 errors, 0 warnings)
  • No new dependencies added
  • Follows existing i18n conventions exactly
  • Unit tests updated (locale reset in beforeEach)

Additional Notes

This PR focuses on coverage breadth — translating the strings users see most often. The i18n.ts architecture already supports adding more locales (zh-TW, ja, etc.) by adding another resource object. The inline defaultValue pattern means untranslated keys always fall back to readable English.

…, inspector, approval card, sidebar, and settings

Expand the existing react-i18next infrastructure to cover the high-visibility
UI surfaces that were still hardcoded in English:

- Thread header: trust state, paper/fork actions, review panel toggle
- Goal rail: all CRUD labels, status text, editor form
- Approval card: action buttons, detail text, aria labels
- Inspector: tab labels, aria landmarks
- Sidebar: empty states, session counts, footer status
- Settings: updates card, diagnostics card
- Runtime notice: offline state, restart action

The locale auto-detection (navigator.language) and manual override (Settings →
Language) already work; this commit adds the Chinese strings those paths need.

Also resets the i18n language in the App test beforeEach to prevent state leaks
between tests now that more components consume the translation context.
@Zongwei9888
Zongwei9888 merged commit 2d898a6 into HKUDS:main Aug 28, 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.

[Feature Request]: Support Simplified Chinese UI / i18n for Desktop app

2 participants