Skip to content

Localize remaining English strings in tray UI#624

Merged
shanselman merged 5 commits into
openclaw:masterfrom
RBrid:user/rbrid/LocalizeStrings1
Jun 8, 2026
Merged

Localize remaining English strings in tray UI#624
shanselman merged 5 commits into
openclaw:masterfrom
RBrid:user/rbrid/LocalizeStrings1

Conversation

@RBrid

@RBrid RBrid commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Adopts the standard x:Uid + LocalizationHelper pattern for English strings that were previously hard-coded across the WinUI tray app.

Pages wired with x:Uid:

  • AgentEventsPage, SkillsPage, SessionsPage, SandboxPage
  • CronPage (full form, presets, infobars, empty/loading state)
  • HubWindow title status text

Runtime strings routed through LocalizationHelper.GetString / Format / GetConnectionStatusText:

  • BindingsPage, ConfigPage, CronPage, DebugPage, SessionsPage, UsagePage InfoBar titles
  • HubWindow.BuildCommandList (23 command palette entries + 5 toggle subtitles)
  • CommandCenterStateBuilder (15 warning titles)
  • AgentEventsPage Live/Offline status; SkillsPage badge + count formats

Adds new resw keys across all 5 locales (en-us, fr-fr, nl-nl, zh-cn, zh-tw). Each new key is registered in LocalizationValidationTests so the key-parity, format-placeholder, and mojibake-detector tests pass.


Master merge update (commit 8fe52196)

Merged in master to resolve drift with PR #558 / #597 / #686 that landed since this PR opened. Eleven conflicts resolved:

  • 6 XAML files (AgentEventsPage, ConnectionPage, CronPage, SandboxPage, SessionsPage, HubWindow): took master versions, which already cover the x:Uid wiring
  • CronPage.xaml.cs: master + re-applied 2 hunks unique to this PR (JobCompletedInfoBar, ShowDisconnected)
  • 5 Resources.resw files: reset to master and re-injected the 80 unique keys via text injection to preserve XML entities (")
  • LocalizationValidationTests.cs: pruned 17 obsolete and 7 over-deferred entries from InvariantOrDeferredResourceKeys

Localization regression caught during merge review

Adversarial dual-model review (Claude Opus + GPT Codex) flagged a real regression: AgentEventsPage and SkillsPage runtime code overrides XAML defaults with LocalizationHelper.GetString / Format calls. The 7 corresponding keys had been seeded English-only across all locales, so fr/nl/zh users would have seen English status badges and skill counters at runtime despite translated XAML defaults.

Fixed by translating those 7 keys in fr-fr, nl-nl, zh-cn, zh-tw using the existing translated XAML defaults as the canonical source (28 strings total):

Key fr-fr nl-nl zh-cn zh-tw
AgentEventsPage_Status_Live En direct Actueel 实时 即時
AgentEventsPage_Status_Offline Hors ligne Niet verbonden 离线 離線
SkillsPage_EnabledHeaderFormat Activées ({0}) Ingeschakeld ({0}) 已启用 ({0}) 已啟用 ({0})
SkillsPage_DisabledHeaderFormat Désactivées ({0}) Uitgeschakeld ({0}) 已禁用 ({0}) 已停用 ({0})
SkillsPage_CountFormat ({0}/{1} activées) ({0}/{1} ingeschakeld) ({0}/{1} 已启用) ({0}/{1} 已啟用)
SkillsPage_BadgeEnabled Activée Ingeschakeld 已启用 已啟用
SkillsPage_BadgeDisabled Désactivée Uitgeschakeld 已禁用 已停用

nl-nl AgentEventsPage_Status_Offline uses "Niet verbonden" instead of the loanword "Offline" because the runtime check is Status == Connected (a connection state, not user presence) and the all-or-none parity test rejects byte-identical matches. Also stripped a stray UTF-8 BOM from nl-nl/Resources.resw so all 5 locales share the same encoding.

Validation

  • ./build.ps1 clean
  • OpenClaw.Shared.Tests: 2045 passed / 29 skipped
  • OpenClaw.Tray.Tests: 936 passed / 0 failed
  • Key parity: 1885 entries per locale across all 5 locales

Fixes #569.

@clawsweeper

clawsweeper Bot commented Jun 1, 2026

Copy link
Copy Markdown

Codex review: needs real behavior proof before merge. Reviewed June 4, 2026, 4:43 PM ET / 20:43 UTC.

Summary
The PR localizes remaining hard-coded tray UI strings by routing code-behind text through LocalizationHelper, adding x:Uid/resource entries across five locales, and extending localization validation coverage.

Reproducibility: not applicable. this is a localization cleanup PR rather than a bug report. Current master still has representative hard-coded tray strings, so review is based on source, diff, comments, and repository policy.

Review metrics: 2 noteworthy metrics.

  • Changed files: 19 files changed. The current diff spans tray runtime code, five locale resource files, and localization validation tests, so real UI proof matters more than source inspection alone.
  • Locale resources: 5 Resources.resw files changed. Every supported locale receives new keys, including many intentionally deferred English values that tests can validate structurally but not visually.

Merge readiness
Overall: 🧂 unranked krab
Proof: 🧂 unranked krab
Patch quality: 🐚 platinum hermit
Result: blocked until real behavior proof is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P1] Add redacted screenshots, recording, terminal output, copied live output, linked artifacts, or logs from a real tray run in a non-English or deferred-locale setup.

Proof guidance:

  • [P1] Needs real behavior proof before merge: The PR body reports tests and build output but public comments and body do not show after-fix real tray behavior proof. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Mantis proof suggestion
A desktop visual proof would materially help verify representative localized tray surfaces in a real locale. A maintainer can ask Mantis to capture proof by posting a new PR comment that starts with the OpenClaw Mantis account mention, followed by:

visual task: verify the tray UI in a non-English locale shows localized/deferred strings for Cron, Sessions, Skills, Agent Events, Connection gateway controls, and command center warnings.

Risk before merge

  • [P1] The PR still lacks after-fix real tray proof in a non-English or deferred-locale setup.

Maintainer options:

  1. Decide the mitigation before merge
    Land the localization cleanup after redacted real tray proof demonstrates representative affected tray surfaces under a non-English or deferred locale.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P1] Contributor proof is still missing, so maintainers need to wait for or request real tray evidence rather than queue an automated repair.

Security
Cleared: No dependency, secret, auth, sandbox-enforcement, or supply-chain change was found in the current diff.

Review details

Best possible solution:

Land the localization cleanup after redacted real tray proof demonstrates representative affected tray surfaces under a non-English or deferred locale.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this is a localization cleanup PR rather than a bug report. Current master still has representative hard-coded tray strings, so review is based on source, diff, comments, and repository policy.

Is this the best way to solve the issue?

Yes for the implementation direction: x:Uid plus LocalizationHelper matches the repository localization pattern. The remaining blocker is merge evidence from a real tray run, not a different code path.

AGENTS.md: found and applied where relevant.

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

Label changes

Label changes:

  • remove merge-risk: 🚨 security-boundary: Current PR review selected no merge-risk labels.

Label justifications:

  • P3: This is tray localization cleanup and proof follow-up rather than an urgent runtime regression.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body reports tests and build output but public comments and body do not show after-fix real tray behavior proof. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed

What I checked:

  • AGENTS policy read: AGENTS.md requires ./build.ps1 plus shared and tray tests after changes, and the PR body now reports all three commands. (AGENTS.md:5, 99efc50cbc22)
  • PR proof check: Public issue comments contain the earlier proof request and a re-review command/status, but no screenshot, recording, copied live output, linked artifact, or redacted runtime log. (8fe52196c3a6)
  • Current master still has target strings: Current master still has runtime hard-coded Live/Offline badge text in AgentEventsPage, so the PR is not fully implemented on main. (src/OpenClaw.Tray.WinUI/Pages/AgentEventsPage.xaml.cs:99, 99efc50cbc22)
  • Existing localization pattern: The localization guide says XAML uses x:Uid resource keys and C# runtime strings use LocalizationHelper.GetString, matching the PR's direction. (docs/LOCALIZATION.md:53, 99efc50cbc22)
  • Current PR diff scope: The current head diff is 19 files, +1405/-85, covering code-behind localization, five locale resource files, and localization validation tests. (8fe52196c3a6)
  • Branch implementation sample: The PR head localizes GatewayHostAccess terminal label and tooltip strings through the new GatewayHostAccessLocalization delegates, wired in App.xaml.cs. (src/OpenClaw.Tray.WinUI/Services/GatewayHostAccess.cs:78, 8fe52196c3a6)

Likely related people:

  • Christine Yan: Blame and log show the current LocalizationHelper, LocalizationValidationTests deferred-key policy, and representative tray page localization surface coming from the merged localization pass commit. (role: recent localization area contributor; confidence: high; commits: 85445c78066b; files: src/OpenClaw.Tray.WinUI/Helpers/LocalizationHelper.cs, src/OpenClaw.Tray.WinUI/Pages/AgentEventsPage.xaml.cs, tests/OpenClaw.Tray.Tests/LocalizationValidationTests.cs)
  • ranjeshj: The gateway terminal controls and GatewayHostAccess files that this PR localizes were introduced by the merged gateway terminal controls work. (role: recent adjacent gateway-controls contributor; confidence: medium; commits: 0b2f9fea3dd9; files: src/OpenClaw.Tray.WinUI/Pages/ConnectionPage.xaml.cs, src/OpenClaw.Tray.WinUI/Services/GatewayHostAccess.cs, tests/OpenClaw.Tray.Tests/GatewayHostAccessTests.cs)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. labels Jun 1, 2026
@RBrid RBrid force-pushed the user/rbrid/LocalizeStrings1 branch from d6d0342 to 7fbee25 Compare June 1, 2026 21:28
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. label Jun 1, 2026
Adopts the standard x:Uid + LocalizationHelper pattern for English strings that were previously hard-coded across the WinUI tray app.

Pages wired with x:Uid:

- AgentEventsPage, SkillsPage, SessionsPage, SandboxPage

- CronPage (full form, presets, infobars, empty/loading state)

- HubWindow title status text

Runtime strings routed through LocalizationHelper.GetString / Format / GetConnectionStatusText:

- BindingsPage, ConfigPage, CronPage, DebugPage, SessionsPage, UsagePage InfoBar titles

- HubWindow.BuildCommandList (23 command palette entries + 5 toggle subtitles)

- CommandCenterStateBuilder (15 warning titles)

- AgentEventsPage Live/Offline status; SkillsPage badge + count formats

Adds 67 new resw keys, seeded English-only across all 5 locales (en-us, fr-fr, nl-nl, zh-cn, zh-tw) using the established deferred-translation pattern. Each new key is registered in LocalizationValidationTests.InvariantOrDeferredResourceKeys so the key-parity, format-placeholder, and mojibake-detector tests pass.

Validated: Tray.Tests 877/877; Shared.Tests 2045 passed / 29 skipped; localization suite 32/32.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@RBrid RBrid force-pushed the user/rbrid/LocalizeStrings1 branch from 7fbee25 to c7861f3 Compare June 1, 2026 21:40
@RBrid

RBrid commented Jun 1, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 1, 2026

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@RBrid RBrid marked this pull request as ready for review June 2, 2026 00:03
RBrid and others added 4 commits June 1, 2026 19:19
Empty commit to retrigger automated review after the previous re-review workflow failed due to a hardcoded 'main' branch lookup against this repo (default branch is 'master').

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Addresses the rest of issue openclaw#569 that the original PR commit missed.

Changes:
- ConnectionPage.xaml: remove hardcoded English ToolTipService.ToolTip /
  AutomationProperties.Name from the WSL gateway Start/Stop/Restart
  buttons (now resolved via x:Uid + attached-property resw keys), and
  from StripTerminalButton (set dynamically in code-behind from the
  localized GatewayHostAccessPlan).
- ConnectionPage.xaml.cs: switch the parameterized host-controls
  description to LocalizationHelper.Format so a translator-side
  FormatException surfaces the raw template instead of crashing the
  page. Also call AutomationProperties.SetName on the WSL
  GatewayHostOpenTerminalButton alongside SetToolTip so screen readers
  announce the localized 'Open terminal' / 'Open SSH terminal' label.
- Services/GatewayHostAccess.cs: localize TerminalLabel,
  TerminalTooltip, and DisabledReason at the data source via a small
  delegate-based indirection (GatewayHostAccessLocalization). Defaults
  to identity (return the resource key) so the file stays unit-testable
  without a WinUI runtime; App.xaml.cs wires the delegates up to
  LocalizationHelper at startup so the running app sees real localized
  strings.
- Strings/{en-us,fr-fr,nl-nl,zh-cn,zh-tw}/Resources.resw: add 11 new
  keys for the button tooltip/automation-name attached properties and
  the GatewayHostAccess plan strings. English-only seeded; deferred
  translation per existing convention.
- LocalizationValidationTests.cs: register the new keys in
  InvariantOrDeferredResourceKeys (required by the all-or-none
  cross-locale parity test).

Validated with the WinUI build, OpenClaw.Tray.Tests (934 passed),
OpenClaw.Shared.Tests (2045 passed / 29 skipped), and
scripts/Test-Localization.ps1 -StrictHardcodedXaml (baseline only).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Resolves conflicts between PR openclaw#624 (localize remaining tray strings) and the
PR openclaw#558 / PR openclaw#597 / openclaw#686 localization work landed in master.

Conflict resolutions
- 6 XAML files (AgentEventsPage, ConnectionPage, CronPage, SandboxPage,
  SessionsPage, HubWindow): took master versions
- CronPage.xaml.cs: master + re-applied 2 openclaw#624 hunks (JobCompletedInfoBar,
  ShowDisconnected)
- 5 Resources.resw files: reset to master and re-injected 80 unique openclaw#624 keys
  via text injection so XML entities (&quot;) are preserved verbatim
- LocalizationValidationTests.cs: pruned 17 obsolete and 7 over-deferred
  entries from InvariantOrDeferredResourceKeys

Regression caught by adversarial review
- AgentEventsPage / SkillsPage runtime code overrides XAML defaults with
  LocalizationHelper.GetString / Format calls. The 7 corresponding keys were
  seeded English-only across all locales so fr/nl/zh users would have seen
  English status badges and skill counters at runtime
- Translated those 7 keys in fr-fr, nl-nl, zh-cn, zh-tw using the existing
  XAML translations as canonical source (28 strings total)
- nl-nl AgentEventsPage_Status_Offline = "Niet verbonden" (matches the
  Status == Connected runtime check) so the all-or-none parity test passes
- Stripped UTF-8 BOM from nl-nl/Resources.resw introduced by the rewrite so
  all 5 locales share the same encoding

Validation
- ./build.ps1 clean
- OpenClaw.Shared.Tests: 2045 passed / 29 skipped
- OpenClaw.Tray.Tests: 936 passed / 0 failed
- Key parity: 1885 entries per locale across all 5 locales

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@clawsweeper clawsweeper Bot removed the merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. label Jun 4, 2026
@shanselman shanselman merged commit 25c11dd into openclaw:master Jun 8, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Localization Audit] Hard-coded XAML strings need x:Uid localization (69 candidates across 7 files)

2 participants