feat: complete Chinese localization + contributor guide#60
Merged
shanselman merged 4 commits intomasterfrom Mar 18, 2026
Merged
feat: complete Chinese localization + contributor guide#60shanselman merged 4 commits intomasterfrom
shanselman merged 4 commits intomasterfrom
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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):
Testing:
PrimaryLanguageOverride = "zh-CN"hardcoded in App constructor for local testing#if DEBUGDocumentation:
docs/LOCALIZATION.md— explains how to add a new language (just copyen-us/Resources.resw, translate, submit PR)How to test
dotnet build src\OpenClaw.Tray.WinUI -r win-x64Key counts
cc @Kobe9312 — your original Chinese translations from PR #30 inspired this infrastructure!