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:Uid attributes 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"/> with StatusHeader.Text = STATUS in .resw
C# runtime strings
Create a LocalizationHelper static class with ResourceLoader for C# strings
Replace hardcoded strings in:
App.xaml.cs: menu items (Settings, Status, Chat, etc.), status labels, channel icons
WelcomeDialog.cs: title, body text, button labels
UpdateDialog.cs: title, version text, button labels
QuickSendDialog.cs: title, placeholder, button text, status messages
SettingsWindow.xaml.cs: runtime status strings (Testing..., Connected!, Failed)
StatusDetailWindow.xaml.cs: Last check: prefix, Unknown fallback
Map ConnectionStatus enum to localized display strings instead of raw .ToString()
Ensure culture-invariant persistence
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
/cc @Kobe9312
Overview
Implement proper WinUI localization using
.reswresource 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
src/OpenClaw.Tray.WinUI/Strings/en-us/Resources.reswx: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)<TextBlock x:Uid="StatusHeader" Text="STATUS"/>withStatusHeader.Text = STATUSin .reswC# runtime strings
LocalizationHelperstatic class withResourceLoaderfor C# stringsApp.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,UnknownfallbackConnectionStatusenum to localized display strings instead of raw.ToString()Ensure culture-invariant persistence
.ToString()on enums produces culture-dependent persisted valuesCultureInfo.InvariantCulturefor any non-display formattingPhase 2: Add Chinese Simplified translation
src/OpenClaw.Tray.WinUI/Strings/zh-cn/Resources.reswPhase 3: Validation
Out of scope
References
/cc @Kobe9312