Skip to content

feat: complete Chinese localization + contributor guide#60

Merged
shanselman merged 4 commits intomasterfrom
feat/complete-chinese-localization
Mar 18, 2026
Merged

feat: complete Chinese localization + contributor guide#60
shanselman merged 4 commits intomasterfrom
feat/complete-chinese-localization

Conversation

@shanselman
Copy link
Collaborator

What

Completes the Chinese (zh-CN) localization by extracting and translating all remaining hardcoded English strings, and adds a contributor guide for adding new languages.

Changes

Localization (163 keys, up from 125):

  • Toast notifications: device/node, session, health check, screen capture, camera, activity stream tip
  • CanvasWindow: error title, retry button, ready state HTML
  • WebChatWindow: error messages, unavailable state, certificate/connection errors
  • DownloadProgressDialog: title, progress text
  • TrayMenuWindow: window title

Testing:

  • PrimaryLanguageOverride = "zh-CN" hardcoded in App constructor for local testing
  • ⚠️ Remove before merging to master — or wrap in #if DEBUG

Documentation:

  • docs/LOCALIZATION.md — explains how to add a new language (just copy en-us/Resources.resw, translate, submit PR)

How to test

  1. Build with dotnet build src\OpenClaw.Tray.WinUI -r win-x64
  2. Run the app — all UI should appear in Chinese
  3. Check: Settings, Status, Activity Stream, Notifications, tray menu, toasts

Key counts

  • en-US: 163 keys
  • zh-CN: 163 keys (in sync ✅)

cc @Kobe9312 — your original Chinese translations from PR #30 inspired this infrastructure!

shanselman and others added 4 commits March 17, 2026 20:20
Localize ~40 remaining hardcoded English strings across:
- Toast notifications (device, session, node, health, camera, activity)
- CanvasWindow (error, retry, ready state)
- WebChatWindow (error messages, unavailable state)
- DownloadProgressDialog (title, progress text)
- TrayMenuWindow title

Both en-US and zh-CN resource files now have 163 keys (up from 125),
fully in sync. Adds PrimaryLanguageOverride for local zh-CN testing.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Explains how to add a new language by contributing a single .resw file.
Covers key naming conventions, testing locally, and validation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
PrimaryLanguageOverride throws InvalidOperationException on unpackaged
WinUI3 apps. Switch to ResourceManager with a ResourceContext qualifier
override, which works reliably in both packaged and unpackaged modes.

Adds LocalizationHelper.SetLanguageOverride() API that can be called
before any GetString() usage to force a specific language.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove zh-CN SetLanguageOverride from App constructor (was for local
testing only). Update LOCALIZATION.md with correct testing instructions
using LocalizationHelper.SetLanguageOverride() instead of the WinRT
PrimaryLanguageOverride which doesn't work on unpackaged apps.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@shanselman shanselman merged commit c85d4e7 into master Mar 18, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant