Skip to content

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

Closed

Description

@github-actions

Summary

pwsh .\scripts\Test-Localization.ps1 exits 0 but emits 69 candidate hard-coded XAML string warnings across 7 files. No x:Uid attributes or matching Resources.resw entries exist for these strings. Fixing requires accurate translations in all 5 active locales (en-us, fr-fr, nl-nl, zh-cn, zh-tw), which makes the full fix too broad to perform automatically without risking mistranslations.


Findings

Pages/AgentEventsPage.xaml (2 strings)

  • <TextBlock x:Name="LiveText" Text="Live" — missing x:Uid
  • <TextBlock Text="Clear" inside ClearButton — missing x:Uid

Pages/CronPage.xaml (57+ strings — newly added form)

All labels, placeholders, and button text in the "New cron job" form are hard-coded. Affected elements include:

  • Page title "Cron Jobs", toolbar "Refresh", "New job"
  • <ConnectionInfoBar> title "Gateway disconnected" and message "Connect to a gateway to load cron jobs."
  • <Button Content="Open Connection">
  • Form fields: "Name", "Schedule", "Expression", "Timezone", "Every", "Unit", "Run at", "Prompt / payload", "Delivery", "Channel", "Advanced options", "Session behavior", "Wake mode"
  • ComboBox items: "Every", "At", "Cron", "Minutes", "Hours", "Days", "Silent (none)", "Notify me (announce)", "New session each run", "Resume main session", "Now (immediate)", "Queue (wait for idle)"
  • Quick preset buttons: "Hourly", "Daily 9am", "Daily 6pm", "Weekdays", "Weekly"
  • Timezone ComboBox items (these are TZ identifiers — may be intentionally non-localized)
  • PlaceholderText: "Morning brief", "Optional", "Date", "3:30 PM", "What should the agent do?", "e.g. webchat"
  • <FormCancelButton Content="Cancel">, <FormSaveButton Content="Create job">
  • Empty/loading states: "Loading cron jobs...", "No cron jobs configured", "Cron jobs will appear here when configured via the gateway."

Pages/SandboxPage.xaml (1 auditor-flagged string)

  • <TextBlock Text="Commands the agent runs directly on the gateway aren't..." — long description paragraph missing x:Uid

Pages/SessionsPage.xaml (3 strings)

  • <TextBlock Text="Conversations this gateway is currently handling, grouped by channel.">
  • <TextBlock Text="Sessions appear here when a channel is connected and traffic is flowing.">
  • <Button Content="Open chat">

Pages/SkillsPage.xaml (2 strings)

  • <TextBlock x:Name="EnabledHeaderText" Text="Enabled"
  • <TextBlock x:Name="DisabledHeaderText" Text="Disabled"

Pages/VoiceSettingsPage.xaml (2 strings)

  • <TextBlock x:Name="PiperPreviewLabel" Text="Preview">
  • <TextBlock x:Name="PreviewVoiceLabel" Text="Preview Voice">

Windows/HubWindow.xaml (1 string)

  • <TextBlock x:Name="TitleStatusText" Text="Disconnected">

Recommended fix

For each affected control:

  1. Add x:Uid to the XAML element — use the naming convention <PageName>_<ControlName> or <ControlName> when the name is already unique (e.g., x:Uid="CronPage_FormSaveButton").

  2. Add matching resource keys to every Resources.resw in src\OpenClaw.Tray.WinUI\Strings\<locale>\:

    • For Text= → ControlUid.Text
    • For Content= → ControlUid.Content
    • For PlaceholderText= → ControlUid.PlaceholderText
    • For Header= → ControlUid.Header
  3. Translate all 5 locales: en-us, fr-fr, nl-nl, zh-cn, zh-tw.

  4. Timezone ComboBox items (America/New_York, UTC, etc.) are IANA identifiers and should not be localized — remove the Content= text values from the warning scope or add an exclusion to Test-Localization.ps1.

  5. Re-run pwsh .\scripts\Test-Localization.ps1 -StrictHardcodedXaml to confirm clean.

Quick wins (low risk, English only needed as seed)

The smallest safe subset to fix first:

  • HubWindow.xaml — TitleStatusText "Disconnected"
  • SkillsPage.xaml — "Enabled" / "Disabled" headers
  • SessionsPage.xaml — "Open chat" button
  • AgentEventsPage.xaml — "Live" badge and "Clear" button

Generated by Localization Audit; see workflow run.

  • expires on Jun 11, 2026, 5:51 AM UTC

Activity

  1. clawsweeper commented on May 28, 2026

    @clawsweeper

    Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed May 28, 2026, 2:02 AM ET / 06:02 UTC.

    Summary
    Keep open: current main still reproduces the 69 hard-coded XAML localization candidates, and the open partial draft only covers a small quick-win subset. The work is actionable, but full cleanup needs maintainer localization decisions for translations and invariant timezone identifiers.

    Reproducibility: yes. Running pwsh ./scripts/Test-Localization.ps1 -SkipDotNetTests -StrictHardcodedXaml on current main fails with 69 candidates, and source inspection shows the listed controls still lack x:Uid.

    Next step
    Manual review is safer because the full fix requires vetted translations, invariant-string policy, and coordination with the open partial draft.

    Review details

    Best possible solution:

    Land a maintainer-approved localization cleanup that adds x:Uid/resource keys for every truly localizable string, explicitly exempts invariant identifiers, and either finishes or supersedes the partial draft at #536.

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

    Yes. Running pwsh ./scripts/Test-Localization.ps1 -SkipDotNetTests -StrictHardcodedXaml on current main fails with 69 candidates, and source inspection shows the listed controls still lack x:Uid.

    Is this the best way to solve the issue?

    Unclear for automation. Adding x:Uid and resource keys is the right shape, but vetted translations and timezone-invariant handling need maintainer/localization judgment before a broad fix lands.

    AGENTS.md: found, but no applicable review policy affected this item.

    Remaining risk / open question:

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

    Label changes

    Label changes:

    • remove clawsweeper:fix-shape-clear: Current issue advisory state no longer selects this label.

    Label justifications:

    • P3: This is low-risk localization debt and polish rather than a broken core workflow or urgent regression.
    • impact:other: The issue affects user-visible localization coverage, which is maintainer-visible but does not fit the specific owned impact categories.
    Evidence reviewed

    What I checked:

    • Repository policy read: Read the full target AGENTS.md; its build/test guidance applies after code changes, but this was a read-only review with no repository mutation. (AGENTS.md:1, 6a5921883c86)
    • Current main checked: The checkout is at the provided current main SHA. (6a5921883c86)
    • Current-main reproduction: The localization audit fails in strict mode with 69 candidate hard-coded XAML strings, matching the issue report. (scripts/Test-Localization.ps1:138, 6a5921883c86)
    • CronPage source evidence: CronPage still has many user-visible Text, Content, Title, Message, and PlaceholderText values without x:Uid, including the page title, toolbar, connection warning, form fields, presets, and empty states. (src/OpenClaw.Tray.WinUI/Pages/CronPage.xaml:29, 6a5921883c86)
    • Non-Cron source evidence: The quick-win strings are still present without x:Uid on current main, including AgentEventsPage Live/Clear, SessionsPage subtitle/empty copy, SkillsPage Enabled/Disabled, VoiceSettings preview labels, Sandbox prose, and HubWindow Disconnected. (src/OpenClaw.Tray.WinUI/Pages/AgentEventsPage.xaml:24, 6a5921883c86)
    • Existing localization contract: LocalizationValidationTests already enforces that any localizable attribute on an x:Uid element has a matching en-us Resources.resw key, so the requested fix shape aligns with existing test structure. (tests/OpenClaw.Tray.Tests/LocalizationValidationTests.cs:330, 6a5921883c86)

    Likely related people:

    • Ranjesh: Current blame shows the localization validation test and original CronPage/audit script surface dating to ed126f2, which makes this person a useful routing candidate for the audit mechanics and CronPage baseline. (role: introduced audit surface; confidence: high; commits: ed126f2aac6d; files: scripts/Test-Localization.ps1, tests/OpenClaw.Tray.Tests/LocalizationValidationTests.cs, src/OpenClaw.Tray.WinUI/Pages/CronPage.xaml)
    • bakudies: Recent commits d4b35d4 and 7e88b14 touched broad XAML localization and the current CronPage UI; blame attributes current CronPage title and toolbar strings to 7e88b14. (role: recent WinUI localization and UI contributor; confidence: high; commits: d4b35d4941c0, 7e88b14eeab6; files: src/OpenClaw.Tray.WinUI/Pages/CronPage.xaml, src/OpenClaw.Tray.WinUI/Pages/SessionsPage.xaml, src/OpenClaw.Tray.WinUI/Pages/SkillsPage.xaml)
    • Scott Hanselman: Commit 1be9ce1 added the WinUI XAML resource foundation and current HubWindow status-line resource work, and nearby merge history shows repeated involvement in related WinUI branches. (role: localization foundation and recent area contributor; confidence: medium; commits: 1be9ce146234, 8714381248a2; files: src/OpenClaw.Tray.WinUI/Windows/HubWindow.xaml, src/OpenClaw.Tray.WinUI/Strings/en-us/Resources.resw)
    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.
  2. added
    P3
    impact:other
    issue-rating: 🦀 challenger crab
    clawsweeper:current-main-repro
    clawsweeper:no-new-fix-pr
    clawsweeper:fix-shape-clear
    clawsweeper:needs-maintainer-review
    clawsweeper:needs-product-decision
    and removed
    clawsweeper:fix-shape-clear
    on May 28, 2026
  3. github-actions commented on May 30, 2026

    @github-actions
    ContributorAuthor

    🤖 This is an automated response from Repo Assist.

    A couple of concrete suggestions on prioritizing this work:

    Timezone identifiers should be excluded from the audit — IANA strings like America/New_York and UTC are intentionally not localizable (they're technical identifiers, not user-facing copy). The recommended fix in the issue body is correct: add an exclusion to Test-Localization.ps1 (or add a <!-- localization:ignore --> pattern), so these don't block the clean pass. That's a small change with no translation risk.

    Quick wins don't need all 5 translations up-front — The issue notes that en-us seeds are enough to start. The existing LocalizationValidationTests only checks that x:Uid elements have a matching en-us key; missing fr-fr/nl-nl/zh-cn/zh-tw keys don't fail the test suite. So the 4 quick-win strings (HubWindow.xaml "Disconnected", SkillsPage.xaml "Enabled"/"Disabled", SessionsPage.xaml "Open chat", AgentEventsPage.xaml "Live"/"Clear") can be wired with en-us only now, and translations can follow.

    The existing PR #536 already covers some quick wins — it might be worth a rebase-and-expand rather than a fresh PR, given its history.

    Generated by 🌈 Repo Assist, see workflow run. Learn more.

    To install this agentic workflow, run

    gh aw add githubnext/agentics/workflows/repo-assist.md@97143ac59cb3a13ef2a77581f929f06719c7402a
    
  4. shanselman commented on Jun 8, 2026

    @shanselman
    Collaborator

    Closing as addressed by the merged localization PR #624, which localizes the remaining tray UI English strings using the existing x:Uid / LocalizationHelper resource patterns across the supported locale resource files.

    If a fresh localization audit still finds remaining hard-coded candidates on current master, please reopen or file a focused follow-up with the new candidate list.

  5. locked as resolved and limited conversation to collaborators on Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3automationclawsweeper:current-main-reproclawsweeper:needs-maintainer-reviewclawsweeper:needs-product-decisionclawsweeper:no-new-fix-primpact:otherissue-rating: 🦀 challenger crablocalization

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions