Skip to content

Localize control UI hardcoded strings to zh-CN#39692

Closed
hepeng154833488 wants to merge 2 commits intoopenclaw:mainfrom
hepeng154833488:codex/openclaw-zh-cn-ui-i18n
Closed

Localize control UI hardcoded strings to zh-CN#39692
hepeng154833488 wants to merge 2 commits intoopenclaw:mainfrom
hepeng154833488:codex/openclaw-zh-cn-ui-i18n

Conversation

@hepeng154833488
Copy link
Copy Markdown

Summary\n- move remaining control UI hardcoded strings to translation-backed labels\n- expand en/zh-CN locale maps for channel cards, config form errors, agents, debug, logs, instances, and approval dialogs\n- keep the Control UI localization in source so rebuilt packages stay translated\n\n## Testing\n- npm run build (ui)\n- manual browser verification on the dashboard with zh-CN locale\n

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Mar 8, 2026

Greptile Summary

This PR replaces hardcoded English strings across 19 Control UI view files with t() i18n calls, expanding both en.ts and zh-CN.ts with ~190 new translation keys across 8 new namespaces (channelsView, configFormView, agentsView, debugView, instancesView, logsView, execApprovalView, gatewayUrlView). It also introduces shared formatting helpers (formatBool, formatRelativeOrNa, formatDurationOrNa, formatProbeResult) in channels.shared.ts to eliminate repetitive Yes/No/n/a inline conditionals.

The en/zh-CN key sets are complete and symmetrical. Most of the view changes are straightforward substitutions with no behavioural impact.

Three UX-visible details worth reviewing:

  • debug.ts – The security audit command previously had <span class="mono"> styling for monospace rendering. After refactoring to the translation template, the command loses its monospace formatting and displays as plain text.
  • agents.ts – The "Cron Jobs" tab label silently became "Cron" because the agentsView.tabs.cron translation key contains only "Cron" instead of the original "Cron Jobs".
  • agents-panels-status-files.ts – The last-refresh fallback changed from "never" to t("common.na") ("n/a"), which carries a slightly different meaning—"not applicable" rather than "has never happened."

Confidence Score: 4/5

  • This PR is safe to merge with minor visual/UX refinements worth addressing before shipping.
  • The changes are well-structured localizations with complete en/zh-CN coverage. The three findings are style/UX concerns rather than functional issues: loss of monospace styling on the debug command, an unintentional English label change ("Cron Jobs" → "Cron"), and a subtle semantic shift ("never" → "n/a"). None of these block functionality, but they are worth confirming as intentional or fixing before release.
    • ui/src/ui/views/debug.ts (monospace styling loss on command string)
  • ui/src/ui/views/agents.ts (verify label change from "Cron Jobs" to "Cron")
  • ui/src/ui/views/agents-panels-status-files.ts (verify semantic change from "never" to "n/a")

Last reviewed commit: ba5249e

Comment thread ui/src/ui/views/debug.ts Outdated
Comment thread ui/src/ui/views/agents.ts
Comment thread ui/src/ui/views/agents-panels-status-files.ts Outdated
@openclaw-barnacle
Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Apr 24, 2026
@clawsweeper
Copy link
Copy Markdown
Contributor

clawsweeper Bot commented Apr 26, 2026

Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve.

Keep this PR open. Current main still has the Control UI hardcoded English strings and missing zh-CN coverage that this PR targets, while the live PR remains open, unmerged, and dirty against main. The repaired PR head appears to remain the canonical implementation candidate, and the file list does not add supply-chain-sensitive changes.

Best possible solution:

Keep this PR open as the canonical implementation candidate for the remaining Control UI zh-CN hardcoded-string cleanup. Rebase it onto current main, resolve conflicts, review the exec approval translations, rerun the Control UI i18n validation and changed gate, then merge this branch or an equivalent implementation.

What I checked:

  • Current main still hardcodes exec approval UI copy: On current main, exec approval metadata labels, fallback titles, queue text, and decision buttons are still literal English strings such as Host, Agent, Session, Plugin approval needed, Exec approval needed, Allow once, Always allow, and Deny. (ui/src/ui/views/exec-approval.ts:37, ef58307f843e)
  • Current main still hardcodes logs/debug UI copy: The Logs view still renders hardcoded title/subtitle/filter/export/empty/truncation strings, and Debug still renders hardcoded Snapshots, Status, Security audit, Manual RPC, and Event Log copy. (ui/src/ui/views/logs.ts:61, ef58307f843e)
  • Current main lacks the PR's generated zh-CN coverage: Current main's zh-CN metadata reports 763 translated keys and still leaves the Dreaming restart confirmation in English, while the PR head reports 920 translated keys and translates that confirmation. (ui/src/i18n/.i18n/zh-CN.meta.json:8, ef58307f843e)
  • PR head implements the targeted localization work: The repaired PR head routes exec approval labels/buttons and Logs view labels/placeholders through translation keys, with zh-CN values present for security-sensitive approval text. (ui/src/ui/views/exec-approval.ts:38, 01579ee2905d)
  • Earlier review concerns were repaired on the PR branch: The PR head keeps the security audit command inside a mono span, preserves the English Agents tab as Cron Jobs, and preserves the channel last-success fallback as never. (ui/src/ui/views/debug.ts:62, 01579ee2905d)
  • Live PR state: GitHub API reports the PR open, not draft, not merged, head 01579ee, mergeable_state dirty, with labels app: web-ui, size: L, and clownfish. (01579ee2905d)

Likely related people:

  • vincentkoc: Authored the PR repair commit and commented that ProjectClownfish pushed a narrow repair so the contributor path can stay canonical; this makes him the clearest current routing candidate for rebase/review follow-up on this Control UI i18n PR. (role: repairing maintainer and likely UI follow-up owner; confidence: high; commits: 01579ee2905d; files: ui/src/i18n/locales/en.ts, ui/src/i18n/locales/zh-CN.ts, ui/src/ui/views/exec-approval.ts)

Remaining risk / open question:

  • The PR is currently dirty against main, so it needs a rebase or conflict-resolution pass before merge.
  • Exec approval labels are security-sensitive UI text; the zh-CN wording for allow-once, always-allow, and deny should preserve the approval policy semantics before landing.
  • Because this PR changes generated zh-CN locale output, maintainers should rerun the Control UI i18n sync/check path and the appropriate changed gate after rebase.

Codex review notes: model gpt-5.5, reasoning high; reviewed against ef58307f843e.

@vincentkoc vincentkoc force-pushed the codex/openclaw-zh-cn-ui-i18n branch from ba5249e to 01579ee Compare April 28, 2026 07:55
@vincentkoc
Copy link
Copy Markdown
Member

ProjectClownfish pushed a narrow repair to this branch so the original contributor path can stay canonical.

Source PR: #39692
Validation: pnpm check:changed
Contributor credit is preserved in the branch history and PR context.

@openclaw-clownfish
Copy link
Copy Markdown
Contributor

ProjectClownfish could not safely update this branch, so it opened a narrow replacement PR instead.

Replacement PR: #73980
Source PR: #39692
Contributor credit is preserved in the replacement PR body and changelog plan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui clawsweeper Tracked by ClawSweeper automation size: L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants