← Back to PRs

#23241: feat(ui): add Simplified Chinese (zh-CN) i18n support for Dashboard

by SidQin-cyber open 2026-02-22 04:21 View on GitHub →
app: web-ui size: XL
## Summary - **Problem:** The OpenClaw Dashboard/Control UI only supports English, limiting accessibility for Chinese-speaking users. - **Why it matters:** Chinese users represent a significant portion of the OpenClaw community. Issue #23194 specifically requested zh-CN Dashboard support. - **What changed:** Added 500+ translation keys to both \`en.ts\` and \`zh-CN.ts\` locale files. Updated 20+ view files to use \`t()\` i18n calls instead of hardcoded English strings. Added \`typeof\` guards for \`localStorage\`/\`navigator\` to prevent test environment errors. - **What did NOT change:** No functional logic changes. All existing English UI behavior is preserved as the default fallback. ## Change Type (select all) - [ ] Bug fix - [x] Feature - [ ] Refactor - [ ] Docs - [ ] Security hardening - [ ] Chore/infra ## Scope (select all touched areas) - [ ] Gateway / orchestration - [ ] Skills / tool execution - [ ] Auth / tokens - [ ] Memory / storage - [ ] Integrations - [ ] API / contracts - [x] UI / DX - [ ] CI/CD / infra ## Linked Issue/PR - Closes #23194 ## User-visible / Behavior Changes - Dashboard UI renders in Simplified Chinese when browser locale is \`zh-CN\` or user selects Chinese from language picker - English remains the default fallback for all untranslated keys - Language preference persists via \`localStorage\` ## Security Impact (required) - New permissions/capabilities? \`No\` - Secrets/tokens handling changed? \`No\` - New/changed network calls? \`No\` - Command/tool execution surface changed? \`No\` - Data access scope changed? \`No\` ## Repro + Verification ### Environment - OS: macOS 15.3 (arm64) - Runtime: Node v22+ - Model/provider: N/A - Integration/channel: Dashboard UI - Relevant config: Default ### Steps 1. Start the gateway and open the Dashboard 2. Set browser language to \`zh-CN\` or use the language picker 3. Navigate through all views: Chat, Channels, Usage, Nodes, Exec Approvals, Agents, Config, Logs, Sessions, etc. ### Expected - All UI labels, buttons, placeholders, and status messages display in Simplified Chinese ### Actual - Confirmed: All translated sections render correctly in zh-CN ## Evidence - All 500+ translation keys have corresponding entries in both \`en.ts\` and \`zh-CN.ts\` - TypeScript compilation passes (\`npx tsc --noEmit\`) - CI \`bun test\` passes after adding \`typeof\` guards for \`localStorage\`/\`navigator\` ## Human Verification (required) - Verified scenarios: Navigated through all Dashboard views with zh-CN locale active; confirmed translations display correctly - Edge cases checked: Fallback to English for any missing keys; \`localStorage\` persistence across page reloads; test environment compatibility (no \`ReferenceError\`) - What I did **not** verify: RTL layout (not applicable for zh-CN) ## Compatibility / Migration - Backward compatible? \`Yes\` - Config/env changes? \`No\` - Migration needed? \`No\` ## Failure Recovery (if this breaks) - How to disable/revert this change quickly: Remove \`zh-CN.ts\` locale file or revert the i18n key additions - Files/config to restore: \`ui/src/i18n/locales/en.ts\`, \`ui/src/i18n/locales/zh-CN.ts\`, and all modified view files - Known bad symptoms: Untranslated keys showing as dot-path strings (e.g., \`chat.title\` instead of actual text) ## Risks and Mitigations - Risk: Translation inaccuracies in technical terminology - Mitigation: Used standard Chinese translations for common tech terms; community can submit corrections via follow-up PRs

Most Similar PRs