Skip to content

Simplified Chinese UI following VS display language (#20) - #22

Open
firish wants to merge 2 commits into
mainfrom
feat/zh-hans-l10n
Open

Simplified Chinese UI following VS display language (#20)#22
firish wants to merge 2 commits into
mainfrom
feat/zh-hans-l10n

Conversation

@firish

@firish firish commented Aug 6, 2026

Copy link
Copy Markdown
Owner

简体中文界面 / 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

  • Every user-facing string moved to Resources/Strings.resx (neutral English) + Resources/Strings.zh-Hans.resx (the translation), with hand-written nameof-keyed accessors in Strings.cs (no designer file — the repo builds from the CLI).
  • Culture is read once at package init from VS's display language (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.
  • Any string a future release hasn't translated yet falls back to English individually — a translation gap degrades to a mixed UI, never a broken one.
  • VSSDK packaging skips the current project's satellite assemblies, so a BundleSatelliteInVsix target places zh-Hans/ClaudeCodeVS.resources.dll next to the main assembly in the .vsix.
  • Deliberately still English: the activity feed / Output diagnostics (bug reports stay greppable and answerable), everything sent to the CLI/model (protocol strings, tool results, hook scripts), the two menu entries (VSCT localization is a follow-up in ROADMAP.md), and the "Claude Code" name.

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

Rishi Gulati and others added 2 commits August 6, 2026 07:45
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>
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