← Back to PRs

#10657: feat(ui): add i18n support with English, Chinese, and Portuguese

by SalimBinYousuf1 open 2026-02-06 20:21 View on GitHub →
app: web-ui
Closes #3460 This PR implements a robust, reactive i18n system for the OpenClaw Control UI. ### Key Changes: - **Core i18n Architecture**: A new reactive i18n manager using Lit controllers for instant UI updates. - **Multi-language Support**: Initial translations for English (en), Simplified Chinese (zh-CN), Traditional Chinese (zh-TW), and Brazilian Portuguese (pt-BR). - **UI Integration**: - Added a language selector in the Overview tab. - Localized the sidebar, navigation tabs, page headers, and chat controls. - Persistent language preference via `UiSettings`. - **Extensibility**: Clean structure for easy community contributions of new languages. ### Verification: - Verified with `pnpm build` to ensure no regressions or dynamic import warnings. - Added unit tests for the translation logic. <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> - Introduces a new `ui/src/i18n/*` module with a reactive `I18nManager`, locale definitions (en/zh-CN/zh-TW/pt-BR), and a Lit `I18nController` for automatic re-render on language changes. - Wires translations into core UI rendering (navigation labels, tab titles/subtitles, overview copy, chat control tooltips) via `t(...)` calls. - Persists user locale preference in `UiSettings` and initializes the i18n manager from stored settings. - Adds unit tests covering basic translation and parameter interpolation behavior. <h3>Confidence Score: 3/5</h3> - This PR is mostly safe but has a couple of correctness issues in i18n loading/testing that should be fixed before merging. - Main risk is the i18n manager’s unconditional use of browser globals at module init (can hard-crash in non-browser contexts) and a locale loading path that can silently fail, plus a unit test that doesn’t actually validate the intended fallback behavior. UI integration changes are otherwise straightforward string substitutions. - ui/src/i18n/lib/translate.ts, ui/src/i18n/test/translate.test.ts, ui/src/ui/app.ts <!-- greptile_other_comments_section --> <!-- /greptile_comment -->

Most Similar PRs