Skip to content

[Bug] Control UI i18n: non-English locale not loaded on initialization + incomplete translation coverage #24803

@lig9904

Description

@lig9904

Environment

  • OpenClaw version: 2026.2.22-2
  • OS: macOS

Bug 1: loadLocale() does not load non-English translation bundle

Description

In dist/control-ui/assets/index-D1uIGfCV.js, the Md i18n class constructor calls loadLocale() which reads the locale from localStorage and sets this.locale, but does NOT load the corresponding translation bundle. Only setLocale() does the dynamic import(), but it has a guard if(this.locale !== t) that prevents it from working after loadLocale() already set the locale.

Steps to reproduce

  1. Open Control UI, set language to 简体中文
  2. Refresh the page
  3. UI renders in English despite locale being zh-CN

Root cause

constructor() {
  this.locale = "en"
  this.translations = { en: Ld }  // only English loaded
  this.loadLocale()               // sets this.locale = "zh-CN" but does not load the bundle
}

setLocale("zh-CN") would load the bundle, but since this.locale is already "zh-CN", the if(this.locale !== t) guard skips it entirely.

Suggested fix

Add to the end of loadLocale():

if (this.locale !== "en") {
  const savedLocale = this.locale;
  this.locale = "en";
  this.setLocale(savedLocale);
}

Bug 2: Incomplete i18n coverage

Description

Only the main navigation and Overview tab use the D() translation function. Many sub-pages have hardcoded English strings that bypass the i18n system entirely.

Examples

  • Agent detail tabs: "Overview", "Files", "Tools", "Skills", "Channels", "Cron Jobs" (hardcoded in array)
  • Config editor categories: "Agents", "Channels", "Skills", "Hooks", "Gateway" etc. (hardcoded in Ia object)

These should use D("tabs.xxx") or equivalent to pick up translations from the language bundles, which already contain the translated strings (e.g. zh-CN has tabs.agents: "代理", tabs.channels: "频道" etc.).

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleMarked as stale due to inactivity

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions