Skip to content

feat: localize XAML and code-behind strings#558

Open
christineyan4 wants to merge 7 commits into
openclaw:masterfrom
christineyan4:christiney/localization-pass
Open

feat: localize XAML and code-behind strings#558
christineyan4 wants to merge 7 commits into
openclaw:masterfrom
christineyan4:christiney/localization-pass

Conversation

@christineyan4
Copy link
Copy Markdown
Contributor

Summary

  • Add x:Uid/resource coverage for remaining hardcoded XAML strings across Cron, events, sessions, skills, voice settings, sandbox, and hub views
  • Replace hardcoded user-facing C# strings with LocalizationHelper resource lookups across chat, connection, channels, cron, agent events, schema editor, and status window surfaces
  • Add synchronized resource entries for en-us, fr-fr, nl-nl, zh-cn, and zh-tw; update localization validation invariants for brand/loanword strings

Validation

  • dotnet build src\OpenClaw.Tray.WinUI\OpenClaw.Tray.WinUI.csproj -c Debug -p:Platform=x64
  • dotnet test tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --no-restore -v q
  • Hanselman-style adversarial review: clean

christineyan4 and others added 2 commits May 26, 2026 15:07
Add x:Uid attributes to all 57 elements in CronPage.xaml that had
hardcoded Text, Content, PlaceholderText, Title, or Message properties.
The corresponding .resw entries already exist in all 5 locale files
(en-us, fr-fr, nl-nl, zh-cn, zh-tw).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add x:Uid to 69 XAML elements across 7 pages (CronPage, AgentEventsPage,
  SessionsPage, SkillsPage, VoiceSettingsPage, HubWindow, SandboxPage)
- Replace ~280 hardcoded C# strings with LocalizationHelper.GetString() in
  ChatPage, ConnectionPage, ChannelsPage, ConnectionStatusWindow, CronPage,
  AgentEventsPage, SchemaConfigEditor
- Add all resource keys to 5 locales (en-us, fr-fr, nl-nl, zh-cn, zh-tw)
- Fix CronPage.xaml encoding (Windows-1252 → UTF-8 em dash)
- Add brand/loanword invariants (Tailscale, OK, via SSH) to test allowlist

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@clawsweeper
Copy link
Copy Markdown

clawsweeper Bot commented May 27, 2026

Codex review: needs changes before merge. Reviewed June 3, 2026, 5:52 PM ET / 21:52 UTC.

Summary
The PR localizes remaining WinUI XAML and code-behind strings across tray pages/windows and adds synchronized resource entries for en-us, fr-fr, nl-nl, zh-cn, and zh-tw.

Reproducibility: yes. for the blocking review finding: the PR head adds x:Uid to the WSL host-control XAML, but ApplyGatewayHostAccess immediately overwrites those TextBlocks with hardcoded English. The submitted Chinese Connection page screenshot also shows that English fallback in the live UI.

Review metrics: 2 noteworthy metrics.

  • Changed surface: 21 files, +4912/-384. The PR spans many UI pages and resource files, so visual and dynamic-string review matters beyond a narrow unit-test pass.
  • Locale resources: 5 Resources.resw files changed. Every new key and placeholder needs to stay synchronized across the supported locales before merge.

Merge readiness
Overall: 🦐 gold shrimp
Proof: 🐚 platinum hermit ✨ media proof bonus
Patch quality: 🦐 gold shrimp
Result: needs maintainer review before merge.

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

Rank-up moves:

  • Localize the WSL gateway host-control code-behind overwrite and any adjacent host-control status strings.
  • [P2] Add the missing AGENTS.md-required validation results to the PR body after rerunning the full build, shared tests, and tray tests.

Mantis proof suggestion
A broader desktop visual pass would materially help verify localized pages and truncation after the code-behind fallback is repaired. 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 localized Connection, Channels, Cron, Voice Settings, and Sessions pages in zh-CN or fr-FR, with no English fallback or truncation.

Risk before merge

  • [P1] The WSL gateway host controls still display English in a non-English Connection page because code-behind overwrites the new XAML resources.
  • [P1] The PR body does not show the AGENTS.md-required full build and shared test validation, so repository validation is incomplete from the public evidence.
  • [P2] The patch changes a broad set of localized UI surfaces, so layout/truncation and dynamic-string fallback risk remains beyond what unit tests alone settle.

Maintainer options:

  1. Repair the WSL host-control overwrite (recommended)
    Update the Connection page code-behind so the WSL host title, description, and related status/failure text use localized resource keys instead of hardcoded English before merge.
  2. Accept partial localization
    Maintainers could merge knowing this remains a partial localization pass and track the WSL host-control English fallback as a follow-up.
  3. Split into smaller visual-review slices
    If the broad resource churn is too hard to visually accept, pause this PR and ask for smaller page-by-page localization PRs with focused screenshots.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Update ConnectionPage.ApplyGatewayHostAccess and the related WSL gateway host-control status/failure strings to use LocalizationHelper.GetString/Format resource keys instead of hardcoded English; add matching en-us, fr-fr, nl-nl, zh-cn, and zh-tw resource entries; keep existing connection behavior unchanged; run ./build.ps1, dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore, and dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore.

Next step before merge

  • [P2] A narrow automated repair can localize the WSL host-control overwrite and preserve the rest of the PR.

Security
Cleared: The diff is a localization/resource/UI-string change and does not alter dependencies, CI, secrets, credential storage, or authorization behavior.

Review findings

  • [P2] Route WSL host text through resources — src/OpenClaw.Tray.WinUI/Pages/ConnectionPage.xaml:228-230
Review details

Best possible solution:

Land this after dynamic WSL host-control text is routed through resources, locale key parity is preserved, and the PR body shows the required full build, shared tests, tray tests, and representative localized UI proof.

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

Yes for the blocking review finding: the PR head adds x:Uid to the WSL host-control XAML, but ApplyGatewayHostAccess immediately overwrites those TextBlocks with hardcoded English. The submitted Chinese Connection page screenshot also shows that English fallback in the live UI.

Is this the best way to solve the issue?

No: x:Uid alone is not enough for text that code-behind mutates after load. The narrower maintainable fix is to localize those assignments with LocalizationHelper resource keys and preserve the existing WSL control behavior.

Full review comments:

  • [P2] Route WSL host text through resources — src/OpenClaw.Tray.WinUI/Pages/ConnectionPage.xaml:228-230
    Adding x:Uid here does not actually localize this block at runtime: ApplyGatewayHostAccess immediately resets GatewayHostControlsTitleText.Text and GatewayHostControlsDescriptionText.Text to hardcoded English when the WSL controls are shown, which matches the submitted Chinese screenshot still showing the English description. Please move those code-behind assignments to localized resource lookups or the WSL host section remains partially English in non-English locales.
    Confidence: 0.91

Overall correctness: patch is incorrect
Overall confidence: 0.82

AGENTS.md: found and applied where relevant.

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

Label changes

Label changes:

  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (screenshot): The attached screenshots show after-change localized Connection and Voice Settings pages in a real WinUI app, although they also reveal the WSL host-control fallback called out above.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.
  • remove status: 👀 ready for maintainer look: Current PR status label is status: ⏳ waiting on author.

Label justifications:

  • P3: This is a low-risk localization/polish improvement, with a concrete user-visible blocker but no core runtime outage.
  • merge-risk: 🚨 other: The diff can leave localized UI partially English or visually broken in ways normal CI does not fully settle.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (screenshot): The attached screenshots show after-change localized Connection and Voice Settings pages in a real WinUI app, although they also reveal the WSL host-control fallback called out above.
  • proof: sufficient: Contributor real behavior proof is sufficient. The attached screenshots show after-change localized Connection and Voice Settings pages in a real WinUI app, although they also reveal the WSL host-control fallback called out above.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The attached screenshots show after-change localized Connection and Voice Settings pages in a real WinUI app, although they also reveal the WSL host-control fallback called out above.
Evidence reviewed

Acceptance criteria:

  • [P1] ./build.ps1.
  • [P1] dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore.
  • [P1] dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore.

What I checked:

  • Repository policy read: AGENTS.md was read in full; its validation policy affected this review because the PR body lists a WinUI project build and tray tests but not the required full ./build.ps1 and shared test project validation. (AGENTS.md:1, be64bea0bec8)
  • PR scope: The GitHub API reports PR head c37fd1a with 21 changed files, 4912 additions, and 384 deletions across XAML, code-behind, resources, and localization tests. (c37fd1ad066e)
  • Current-main provenance: Current main still has hardcoded WSL host control text in ConnectionPage.xaml and code-behind, so the central localization work is not already implemented on main. (src/OpenClaw.Tray.WinUI/Pages/ConnectionPage.xaml:220, 7d9152f427a3)
  • Blocking source finding: On the PR head, ConnectionPage.xaml adds x:Uid/resources for the WSL host title/description, but ApplyGatewayHostAccess still assigns GatewayHostControlsTitleText.Text and GatewayHostControlsDescriptionText.Text from hardcoded English literals when the section is shown. (src/OpenClaw.Tray.WinUI/Pages/ConnectionPage.xaml.cs:468, c37fd1ad066e)
  • Screenshot proof inspected: The contributor's Connection page screenshot shows a Chinese-localized page while the WSL gateway description remains English, matching the code-behind overwrite path. (c37fd1ad066e)
  • Static resource parity spot-check: A read-only script over the PR head found zero missing LocalizationHelper.GetString keys across the five resource files for the changed code-behind files, so the remaining blocker is not a broad missing-key failure. (c37fd1ad066e)

Likely related people:

  • Régis Brid: git blame ties ConnectionPage.ApplyGatewayHostAccess, the WSL host controls, and LocalizationHelper to commit 7d9152f, which is the current-main code path the PR must integrate with. (role: introduced behavior and localization helper path; confidence: high; commits: 7d9152f427a3; files: src/OpenClaw.Tray.WinUI/Pages/ConnectionPage.xaml, src/OpenClaw.Tray.WinUI/Pages/ConnectionPage.xaml.cs, src/OpenClaw.Tray.WinUI/Helpers/LocalizationHelper.cs)
  • Ranjesh: recent git history shows cd283cd adding localized local-gateway setup resource entries in the same Resources.resw surface. (role: recent adjacent localization/resource contributor; confidence: medium; commits: cd283cd8681d; files: src/OpenClaw.Tray.WinUI/Strings/en-us/Resources.resw)
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 May 27, 2026
@clawsweeper
Copy link
Copy Markdown

clawsweeper Bot commented May 27, 2026

ClawSweeper PR egg

🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat.

Where did the egg go?
  • The egg game starts only after the PR passes the real-behavior proof check.
  • Before that, no creature or rarity is rolled. The treat waits for real proof.
  • This is still just collectible flavor: proof affects review readiness, not creature quality.

@christineyan4
Copy link
Copy Markdown
Contributor Author

image image

Connection Page, Voice Settings pages localized

@clawsweeper clawsweeper Bot added proof: sufficient Contributor real behavior proof is sufficient. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. and removed 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. labels Jun 3, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient Contributor real behavior proof is sufficient. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant