Skip to content

[Localization Audit] 310 hard-coded XAML strings need localization across 8 WinUI pages #491

@github-actions

Description

@github-actions

Summary

The Test-Localization.ps1 audit script found 310 candidate hard-coded XAML strings that bypass the localization system. None of the 8 affected pages use x:Uid for their user-facing copy; instead they carry raw English strings directly in XAML attributes.

Locales present: en-us, nl-nl, fr-fr, zh-tw, zh-cn.

Findings

File Hard-coded string count
src/OpenClaw.Tray.WinUI/Pages/ConnectionPage.xaml 70
src/OpenClaw.Tray.WinUI/Pages/CronPage.xaml 58
src/OpenClaw.Tray.WinUI/Pages/SandboxPage.xaml 32
src/OpenClaw.Tray.WinUI/Pages/PermissionsPage.xaml 16
src/OpenClaw.Tray.WinUI/Pages/DebugPage.xaml 11
src/OpenClaw.Tray.WinUI/Pages/ChatPage.xaml 5
src/OpenClaw.Tray.WinUI/Pages/InstancesPage.xaml 4
src/OpenClaw.Tray.WinUI/Pages/BindingsPage.xaml 4

Example findings:

  • BindingsPage.xaml: <ConnectionInfoBar Message="Connect to a gateway to load bindings." Title="Gateway disconnected">, <Button Content="Open Connection">
  • ChatPage.xaml: <TextBlock Text="Web Chat Unavailable">, <Button Content="Open in Browser Instead">
  • ConnectionPage.xaml: <TextBlock Text="Operator">, <TextBlock Text="Node mode">, <StripHeadline Text="Not connected">, <StripPrimaryButton Content="Connect">
  • SandboxPage.xaml: <TextBlock Text="Locked Down">, <TextBlock Text="Recommended">, <TextBlock Text="Unprotected">
  • PermissionsPage.xaml: <TextBlock Text="Permissions">, <TextBlock Text="Node mode">, <ExecPolicySavedHint Text="Saved">

Run pwsh .\scripts\Test-Localization.ps1 to reproduce. Run with -StrictHardcodedXaml to make the check fail.

Recommended fix

For each hard-coded string on each affected control:

  1. Add x:Uid to the XAML element, e.g.:
<!-- Before -->
<Button Content="Open Connection" />
<!-- After -->
<Button x:Uid="BindingsOpenConnectionButton" />
  1. Add resource keys to every locale file under src/OpenClaw.Tray.WinUI/Strings/<locale>/Resources.resw:
<data name="BindingsOpenConnectionButton.Content" xml:space="preserve">
  <value>Open Connection</value>
</data>

Provide translated values for nl-nl, fr-fr, zh-tw, and zh-cn.

  1. Preserve {0}-style placeholders in every locale for any format strings.
  2. Leave unchanged: protocol identifiers (system.run), URLs, model names, command names, and brand names like OpenClaw.
  3. Re-run pwsh .\scripts\Test-Localization.ps1 -StrictHardcodedXaml to confirm zero warnings, then run the full test suite per AGENTS.md.

Suggested order: BindingsPage and ChatPage first (fewest strings), then PermissionsPage, DebugPage, InstancesPage, then ConnectionPage, CronPage, SandboxPage.

Generated by Localization Audit; see workflow run.

  • expires on Jun 4, 2026, 5:50 AM UTC

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions