Repository navigation
Closed
Labels
enhancementNew feature or request
Description
Overview
Implement proper WinUI localization using .resw resource files so any language can be added by contributing a single resource file — no source code changes needed.
Prerequisite: #41 (settings persistence fix) — merged or in progress.
Phase 1: Extract English strings to Resources.resw
XAML strings
- Create
src/OpenClaw.Tray.WinUI/Strings/en-us/Resources.resw - Add
x:Uidattributes to all XAML elements with user-visible text in:SettingsWindow.xaml(headers, labels, button text, toggle headers, checkbox content)StatusDetailWindow.xaml(section headers, default text, button text)ActivityStreamWindow.xaml(headers, filter labels, button text)NotificationHistoryWindow.xaml(headers, empty state text)WebChatWindow.xaml(placeholder text)
- Pattern:
<TextBlock x:Uid="StatusHeader" Text="STATUS"/>withStatusHeader.Text = STATUSin .resw
C# runtime strings
- Create a
LocalizationHelperstatic class withResourceLoaderfor C# strings - Replace hardcoded strings in:
App.xaml.cs: menu items (Settings, Status, Chat, etc.), status labels, channel iconsWelcomeDialog.cs: title, body text, button labelsUpdateDialog.cs: title, version text, button labelsQuickSendDialog.cs: title, placeholder, button text, status messagesSettingsWindow.xaml.cs: runtime status strings (Testing..., Connected!, Failed)StatusDetailWindow.xaml.cs:Last check:prefix,Unknownfallback
- Map
ConnectionStatusenum to localized display strings instead of raw.ToString()
Ensure culture-invariant persistence
- Verify all settings save/load uses stable keys (see fix: NotificationSound persisted by display text instead of stable key #41)
- Verify no
.ToString()on enums produces culture-dependent persisted values - Use
CultureInfo.InvariantCulturefor any non-display formatting
Phase 2: Add Chinese Simplified translation
- Create
src/OpenClaw.Tray.WinUI/Strings/zh-cn/Resources.resw - Populate with translations from @Kobe9312's work in Add Chinese (Simplified) localization #30
- Windows automatically selects language based on OS locale
- Verify settings saved on Chinese OS load correctly on English OS
Phase 3: Validation
- Build and run tests
- Verify no mixed-language UI on Chinese locale
- Verify settings round-trip across locales
- Verify WinForms tray is unaffected (shares settings.json)
Out of scope
- WinForms tray localization (evaluate separately — may be sunset)
- Right-to-left layout (future issue)
- Localizing code comments or README (keep English; translated READMEs as separate files are fine)
References
- Closed PR Add Chinese (Simplified) localization #30 (Chinese translation — source-level approach)
- WinUI localization docs
- x:Uid directive
/cc @Kobe9312
Metadata
Metadata
Assignees
Labels
enhancementNew feature or request
Type
Fields
Priority
None yet
Activity
feat: add localization infrastructure with English and Chinese resources
feat: add localization infrastructure with English and Chinese resources
feat: add localization infrastructure with English and Chinese resources
feat: add localization infrastructure with English and Chinese resour…
shanselman commentedon Mar 17, 2026
Implemented in PR #46 (merged). .resw resource files for en-US and zh-CN, x:Uid attributes, LocalizationHelper, all code-behind wired up. Any language can now be added with a single .resw file.