Skip to content

Localize remaining English strings in tray UI#624

Open
RBrid wants to merge 4 commits into
openclaw:masterfrom
RBrid:user/rbrid/LocalizeStrings1
Open

Localize remaining English strings in tray UI#624
RBrid wants to merge 4 commits into
openclaw:masterfrom
RBrid:user/rbrid/LocalizeStrings1

Conversation

@RBrid
Copy link
Copy Markdown
Contributor

@RBrid RBrid commented 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.

Fixes #569.

@clawsweeper
Copy link
Copy Markdown

clawsweeper Bot commented Jun 1, 2026

Codex review: needs real behavior proof before merge. Reviewed June 2, 2026, 9:09 PM ET / 01:09 UTC.

Summary
The PR replaces hard-coded tray UI strings with x:Uid resources and LocalizationHelper calls, seeds new resource keys across five locales, and extends localization validation coverage.

Reproducibility: not applicable. This PR is a localization cleanup rather than a bug report. Current main still shows the linked hard-coded string surface, and review was based on source, diff, comments, and repository policy.

Review metrics: 3 noteworthy metrics.

  • Changed files: 26 files, +1906/-182. The diff spans many tray pages, resource files, and tests, so source review alone is weaker than a short real UI proof.
  • Locale resources: 5 Resources.resw files changed. Every supported locale receives deferred keys and sandbox warning copy that structural tests cannot fully validate semantically.
  • Validation reported: 2 test projects plus localization suite; build result missing. The repository policy requires the full build result before completion.

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 non-English or deferred-locale tray run.
  • [P1] Report the AGENTS-required ./build.ps1 result alongside the shared and tray test results.
  • Show or explicitly call out the sandbox warning in proof so maintainers can verify the safety wording.

Proof guidance:

  • [P1] Needs real behavior proof before merge: The PR body and comments contain tests and a re-review request only; contributor action is needed to add redacted real tray proof and update the PR body so ClawSweeper can re-review.

Mantis proof suggestion
A short desktop proof would materially help verify the localized tray UI and sandbox warning 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 the sandbox warning.

Risk before merge

  • [P1] The PR body and comments still do not include after-fix proof from a real tray run in a non-English or deferred-locale setup.
  • [P1] The PR body reports tray, shared, and localization test results but not the AGENTS-required ./build.ps1 result.
  • [P2] The sandbox warning paragraph is security-boundary user guidance, so maintainers should verify that the final localized/deferred copy remains clear in the actual UI.

Maintainer options:

  1. Require UI proof for sandbox copy (recommended)
    Ask for a redacted screenshot, recording, copied live output, or logs showing representative localized tray surfaces and the sandbox warning before merge.
  2. Accept source-only wording review
    Maintainers can intentionally land the English-seeded sandbox warning after source review if they are comfortable with the safety wording without runtime proof.

Next step before merge

  • [P1] Human handling is needed until the contributor adds real tray proof and reports the required full build result; no narrow automated repair is identified.

Security
Cleared: No dependency, secret, auth, sandbox-enforcement, or supply-chain change was found; the security-sensitive concern is wording verification for sandbox guidance.

Review details

Best possible solution:

Land the localization cleanup after redacted real tray proof, full AGENTS validation reporting, and maintainer comfort with the sandbox warning wording.

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

Not applicable: this PR is a localization cleanup rather than a bug report. Current main still shows the linked hard-coded string surface, and review was 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 and safety-copy verification, not a different code path.

AGENTS.md: found and applied where relevant.

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

Label changes

Label justifications:

  • P3: This is low-urgency tray localization cleanup and merge evidence follow-up rather than an urgent runtime regression.
  • merge-risk: 🚨 security-boundary: The diff changes user-facing sandbox boundary warning text about direct gateway commands reaching Windows resources.
  • 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 and comments contain tests and a re-review request only; contributor action is needed to add redacted real tray proof and update the PR body so ClawSweeper can re-review.
Evidence reviewed

What I checked:

  • AGENTS policy read: Read the full repository AGENTS.md; it requires ./build.ps1 plus shared and tray tests after changes, and this PR body reports shared/tray/localization tests but not the full build. (AGENTS.md:1, 53ff55aff974)
  • PR proof check: PR comments contain the prior ClawSweeper proof request, a contributor re-review request, and a failed bot re-review status, but no screenshot, recording, terminal output, linked artifact, live output, or redacted runtime log from a real tray run. (bba29a055ebf)
  • Current main still needs this work: Current main still has representative hard-coded localizable tray strings such as CronPage title/toolbar text without x:Uid, so the PR is not obsolete on main. (src/OpenClaw.Tray.WinUI/Pages/CronPage.xaml:29, 53ff55aff974)
  • Existing localization pattern: Repository docs say XAML should use x:Uid and runtime strings should use LocalizationHelper.GetString or LocalizationHelper.Format, matching the PR's implementation direction. (docs/LOCALIZATION_CHECK.md:3, 53ff55aff974)
  • Runtime helper surface: Current main already provides LocalizationHelper.GetString, Format, and GetConnectionStatusText, which the PR reuses for runtime strings. (src/OpenClaw.Tray.WinUI/Helpers/LocalizationHelper.cs:6, 53ff55aff974)
  • Diff scope: GitHub reports 26 changed files with 1,906 additions and 182 deletions, including five Resources.resw files and localization validation changes. (bba29a055ebf)

Likely related people:

  • RBrid: Current-main blame ties the localization helper, tray UI pages, resource files, and GatewayHostAccess classifier to the v0.6.0 baseline commit before this PR branch. (role: recent area contributor; confidence: high; commits: 7d9152f427a3; files: src/OpenClaw.Tray.WinUI/Helpers/LocalizationHelper.cs, src/OpenClaw.Tray.WinUI/Pages/CronPage.xaml, src/OpenClaw.Tray.WinUI/Services/GatewayHostAccess.cs)
  • Ranjesh: Recent current-main work changed setup-managed WSL gateway behavior in App.xaml.cs and ConnectionPage.xaml.cs, which overlaps the PR's localized gateway terminal controls. (role: recent adjacent gateway-controls contributor; confidence: medium; commits: f4d4793f744f; files: src/OpenClaw.Tray.WinUI/App.xaml.cs, src/OpenClaw.Tray.WinUI/Pages/ConnectionPage.xaml.cs)
  • AlexAlves87: Recent current-main refactoring extracted App startup configuration near the constructor area where this PR wires GatewayHostAccess localization. (role: recent adjacent App startup contributor; confidence: medium; commits: bfeb3b5c90be; files: src/OpenClaw.Tray.WinUI/App.xaml.cs, src/OpenClaw.Tray.WinUI/Services/StartupInputConfigurator.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
Copy link
Copy Markdown
Contributor Author

RBrid commented Jun 1, 2026

@clawsweeper re-review

@clawsweeper
Copy link
Copy Markdown

clawsweeper Bot commented Jun 1, 2026

🦞🧹
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 3 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. 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)

1 participant