Simplified Chinese UI following VS display language (#20) - #22
Open
firish wants to merge 2 commits into
Open
Conversation
Every user-facing string (panel, dialogs, diff InfoBar, notifications, tooltips) now resolves through Resources/Strings.resx, with a full zh-Hans translation in Strings.zh-Hans.resx and hand-written nameof-keyed accessors in Strings.cs (no designer - the repo builds from the CLI). Culture comes from VS's own display language (SUIHostLocale/IUIHostLocale.GetUILocale at package init), never the thread culture: UI strings are composed on background HTTP-handler threads. LCID 2052 reaches the satellite via the zh-CN -> zh-Hans parent chain; untranslated keys fall back to English per-string. VSSDK packaging skips the current project's satellites, so a BundleSatelliteInVsix target places zh-Hans/ClaudeCodeVS.resources.dll next to the main assembly in the .vsix (satellite probing location). DiffSession's Accept/Reject consts became properties resolving through Strings - the click handler compares actionItem.Text against the same values, so the round-trip holds in any language. Deliberately NOT localized: log/feed diagnostics (greppable bug reports), protocol strings and everything sent to the CLI/model, the two VSCT menu entries, and the "Claude Code" brand. English VS is byte-for-byte unchanged (neutral resx values are the previous literals). Verified by loading the built DLL: zh-CN differs from invariant, 64/64 key parity, satellite present in the vsix. CLAUDE.md gains convention #6 + a Localization section: the maintainer does not read Chinese, so the zh-Hans file is maintained by Claude - every new user-facing string lands in all three files in the same change. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…etting-started/roadmap The user-facing story for the Simplified Chinese UI: a feature bullet in README and the marketplace listing (with the CLI-stays-English caveat and the corrections-welcome invitation), a Language note in the getting-started panel section pointing at International Settings, and a Localization follow-ups section in the roadmap (VSCT menus, more languages on demand, a zh marketplace listing). Co-Authored-By: Claude Fable 5 <noreply@anthropic.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.
简体中文界面 / Simplified Chinese UI
Closes #20.
The extension's UI — panel, dialogs, the diff Accept/Reject bar, tooltips, notifications — now follows Visual Studio's own display language (Tools > Options > Environment > International Settings). Run VS in 中文(简体) and the extension matches its surroundings; English VS is byte-for-byte unchanged.
How it works
Resources/Strings.resx(neutral English) +Resources/Strings.zh-Hans.resx(the translation), with hand-writtennameof-keyed accessors inStrings.cs(no designer file — the repo builds from the CLI).IUIHostLocale.GetUILocale), not the thread culture — UI strings get composed on background HTTP-handler threads too. LCID 2052 (zh-CN) reaches the zh-Hans satellite via the standard parent-chain fallback.BundleSatelliteInVsixtarget placeszh-Hans/ClaudeCodeVS.resources.dllnext to the main assembly in the .vsix.Verification
Loaded the built DLL and resolved resources directly: zh-CN differs from invariant for every key, 64/64 key parity between the two resx files, and the satellite is present in the packaged .vsix.
DiffSession's Accept/Reject round-trip (render vs click-compare) uses the same resolved values, so it holds in any language.A note on review
I am not a native speaker, so I haven't been able to properly test the Chinese UI inside VS. If you read Chinese — please feel free to test it and open a PR for any corrections to
src/ClaudeCodeVS/Resources/Strings.zh-Hans.resx, or open an issue. Translation feedback is very welcome.🤖 Generated with Claude Code