← Back to PRs

#9490: Add Internationalization (i18n) Support

by luuman open 2026-02-05 08:28 View on GitHub →
app: web-ui stale
Summary This PR adds comprehensive internationalization support to the OpenClaw Web UI and command system, enabling users to switch between English and Simplified Chinese. Changes Web UI Internationalization - Add ui/src/i18n/i18n.ts - Core i18n manager with type-safe translation keys - Add ui/src/i18n/LocaleSelector.ts - Language switcher component - Implement t() helper function for easy translation access - Support 490+ translation keys covering all UI surfaces: - Navigation and page titles - Channel cards (WhatsApp, Telegram, Discord, Signal, Slack, iMessage, Nostr, Google Chat) - Sessions, Cron, Skills, Nodes, Config, Debug, Logs pages - Common UI elements (buttons, status labels, form fields) Command System Internationalization - Add src/i18n/commands.ts - Command description translations - Integrate locale-aware command registry with getChatCommands(locale) - Support localized command descriptions, argument labels, and menu text Configuration - Add ui.locale config option ("en" | "zh-CN") - Support locale detection via: - URL parameter (?lang=zh-CN) - Browser language preference - Config setting Supported Languages - English (en) - Default - Simplified Chinese (zh-CN) Test Plan - Verify Web UI displays correctly in English (default) - Verify Web UI displays correctly in Chinese (?lang=zh-CN) - Test locale persistence across page reloads - Verify command descriptions show in correct language - Check all channel cards render translated strings - Validate form labels and button text are translated <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR introduces internationalization across the Web UI and the slash-command registry, adding a typed UI i18n module (`ui/src/i18n/i18n.ts`), a locale selector component, and command translation tables (`src/i18n/commands.ts`). It also wires a new `ui.locale` config value through the config schema and uses it to localize command descriptions and various UI strings (navigation, page titles/subtitles, views, etc.). <h3>Confidence Score: 3/5</h3> - Not safe to merge until the command registry compile errors are fixed. - Review found definite TypeScript compilation issues in `src/auto-reply/commands-registry.ts` (duplicate imports and an unknown `MoltbotConfig` type). The rest of the changes are largely additive i18n plumbing, but these errors will block builds/tests. - src/auto-reply/commands-registry.ts <!-- greptile_other_comments_section --> <sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub> **Context used:** - Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=fd949e91-5c3a-4ab5-90a1-cbe184fd6ce8)) - Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=0d0c8278-ef8e-4d6c-ab21-f5527e322f13)) <!-- /greptile_comment -->

Most Similar PRs