Repository navigation
Add multilingual Java Pack UI with Simplified Chinese support - #1791
Open
Changyong Gong (chagong) wants to merge 2 commits into
Open
Changyong Gong (chagong) wants to merge 2 commits into
Changyong Gong (chagong) wants to merge 2 commits into
Conversation
Localize the manifest, extension-host messages and all eight webviews using VS Code's display language. Add Simplified Chinese catalogs and extraction/regression guards while preserving raw command, setting and telemetry values. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Changyong Gong (chagong)
requested review from
Sheng Chen (jdneo),
Jinbo Wang (testforstephen) and
wenyt (wenytang-ms)
as code owners
November 6, 2026 06:48
There was a problem hiding this comment.
🟡 Changes recommended
The localization test can pass when the bootstrap is missing because indexOf returns -1, leaving broken browser translations after restoration undetected.
1 open issue
What changed in this PR
Adds Simplified Chinese support for Java Pack’s own UI, addressing #1790 and establishing a localization workflow with English fallback.
Changes:
- Externalizes manifest captions, native messages, and webview text while preserving command identifiers and settings values.
- Adds shared localization initialization, escaped HTML handling, and reorderable rich-text placeholders.
- Adds catalog guards, regression tests, English/Chinese AutoTest scenarios, and contributor documentation.
| File | Description |
|---|---|
| tests/webview-localization.test.js | Tests bootstrap safety, fallback, display mappings, and restoration. |
| tests/project-settings.test.js | Updates localization mocks for project settings tests. |
| tests/localized-actions.test.js | Tests translated action routing and cancellation. |
| tests/localization.test.js | Tests catalog completeness and extraction guards. |
| tests/java-runtime.test.js | Updates runtime localization mocks. |
| tests/helpers/l10n.js | Adds a reusable translation mock. |
| test-plans/localization/zh-cn.yaml | Adds Chinese UI acceptance checks. |
| test-plans/localization/en-native.yaml | Adds English native-action and restoration checks. |
| test-plans/java-webview-migration.yaml | Expands English smoke coverage using stable commands. |
| src/welcome/index.ts | Localizes Help Center titles and bootstrap. |
| src/welcome/assets/index.ts | Initializes browser localization before rendering. |
| src/welcome/assets/components/TourPage.tsx | Localizes tour content while preserving telemetry names. |
| src/welcome/assets/components/SocialMediaPanel.tsx | Localizes link captions without changing targets. |
| src/welcome/assets/components/QuickActionPanel.tsx | Localizes quick actions with rich-text placeholders. |
| src/welcome/assets/components/NavigationPanel.tsx | Separates translated labels from action identities. |
| src/welcome/assets/components/Header.tsx | Localizes heading and blog-link text. |
| src/welcome/assets/components/ControllerPanel.tsx | Localizes the visibility checkbox label. |
| src/utils/index.ts | Uses object identity for the translated Install action. |
| src/recommendation/xml.ts | Localizes the XML extension recommendation. |
| src/providers/CodeActionProvider.ts | Localizes the classpath quick-fix caption. |
| src/project-settings/projectSettingsView.ts | Localizes project settings titles and bootstrap. |
| src/project-settings/handlers/CompilerRequestHandler.ts | Localizes the missing-extension notification. |
| src/project-settings/handlers/ClasspathRequestHandler.ts | Localizes dialogs, errors, and confirmation actions. |
| src/project-settings/assets/maven/features/MavenConfigurationView.tsx | Localizes the non-Maven project message. |
| src/project-settings/assets/maven/features/components/Profile.tsx | Localizes Maven profile labels. |
| src/project-settings/assets/mainpage/features/component/SideBar.tsx | Localizes navigation captions. |
| src/project-settings/assets/mainpage/features/component/ProjectSelector.tsx | Localizes the project selector label. |
| src/project-settings/assets/mainpage/features/component/Footer.tsx | Localizes apply-button states. |
| src/project-settings/assets/mainpage/features/component/Exception.tsx | Localizes exception messages with trusted links. |
| src/project-settings/assets/index.tsx | Initializes localization before rendering project settings. |
| src/project-settings/assets/compiler/features/components/Hint.tsx | Localizes build-file guidance. |
| src/project-settings/assets/compiler/features/CompilerConfigurationView.tsx | Localizes compiler controls and warnings. |
| src/project-settings/assets/classpath/features/components/UnmanagedFolderSources.tsx | Localizes unmanaged source controls. |
| src/project-settings/assets/classpath/features/components/Sources.tsx | Localizes source-path editing controls. |
| src/project-settings/assets/classpath/features/components/Output.tsx | Localizes output-path labels and tooltips. |
| src/project-settings/assets/classpath/features/components/Libraries.tsx | Localizes library controls and empty state. |
| src/project-settings/assets/classpath/features/components/JdkRuntime.tsx | Localizes JDK status and actions. |
| src/project-settings/assets/classpath/features/components/Hint.tsx | Localizes classpath persistence guidance. |
| src/project-settings/assets/classpath/features/ClasspathConfigurationView.tsx | Localizes classpath tab captions. |
| src/overview/assets/index.ts | Initializes Overview browser localization. |
| src/l10n/richText.tsx | Adds reorderable React-node placeholders. |
| src/l10n/host.ts | Adds escaped HTML and inert localization bootstrap helpers. |
| src/l10n/display.ts | Maps project types to translated display labels. |
| src/l10n/browser.ts | Initializes browser translations from the host bundle. |
| src/java-runtime/utils/upstreamApi.ts | Localizes upstream runtime warnings. |
| src/java-runtime/index.ts | Localizes legacy runtime titles, dialogs, and inventory errors. |
| src/java-runtime/assets/ToolingJDKPanel.tsx | Localizes tooling runtime information and actions. |
| src/java-runtime/assets/ProjectJDKPanel.tsx | Localizes project runtime information and labels. |
| src/java-runtime/assets/index.ts | Initializes legacy runtime browser localization. |
| src/java-runtime/assets/components/ProjectTypeHint.tsx | Localizes guidance while retaining build examples. |
| src/java-runtime/assets/components/JDKActions.tsx | Localizes JDK installation and location actions. |
| src/java-runtime/assets/components/DefaultJDKSelector.tsx | Localizes the Edit tooltip. |
| src/install-jdk/index.ts | Localizes installer titles and bootstrap. |
| src/install-jdk/assets/index.tsx | Initializes installer browser localization. |
| src/install-jdk/assets/features/InstallJDKView.tsx | Localizes installer tabs and reload guidance. |
| src/install-jdk/assets/features/components/OtherJDKsPanel.tsx | Compacts markup without changing product links. |
| src/install-jdk/assets/features/components/AdoptiumJDKPanel.tsx | Localizes download and version labels. |
| src/formatter-settings/utils.ts | Localizes diagnostics and download-retry actions. |
| src/formatter-settings/index.ts | Localizes formatter HTML and native dialogs. |
| src/formatter-settings/assets/labels.ts | Adds display mappings that preserve formatter values. |
| src/formatter-settings/assets/index.tsx | Initializes formatter browser localization. |
| src/formatter-settings/assets/features/formatterSettings/FormatterSettingView.tsx | Localizes formatter categories and read-only actions. |
| src/formatter-settings/assets/features/formatterSettings/components/Setting.tsx | Localizes setting labels and accessible names. |
| src/ext-guide/index.ts | Localizes guide HTML, descriptions, and buttons. |
| src/ext-guide/assets/index.ts | Localizes the selected-extension count. |
| src/daemon/index.ts | Localizes cache-recovery notification and action. |
| src/commands/handler.ts | Localizes recommendations, installation progress, and AWT messages. |
| src/beginner-tips/index.ts | Localizes beginner-page titles and bootstrap. |
| src/beginner-tips/assets/tabs/QuickStartPanel.tsx | Localizes quick-start guidance while retaining code samples. |
| src/beginner-tips/assets/tabs/FaqPanel.tsx | Localizes FAQ content with trusted links. |
| src/beginner-tips/assets/tabs/DebuggingPanel.tsx | Localizes debugging guidance and action labels. |
| src/beginner-tips/assets/tabs/CodeEditingPanel.tsx | Localizes editing guidance and shortcut labels. |
| src/beginner-tips/assets/index.tsx | Initializes beginner-page browser localization. |
| src/beginner-tips/assets/BeginnerTips.tsx | Localizes the page heading and tabs. |
| scripts/check-localization.js | Checks catalog invariants and extraction drift. |
| README.md | Links to the translation contributor guide. |
| package.nls.zh-cn.json | Adds Simplified Chinese manifest translations. |
| package.nls.json | Adds English manifest resource keys. |
| package.json | Registers catalogs, localized captions, tooling, and dependencies. |
| docs/localization.md | Documents localization conventions, validation, and release gates. |
Review effort: Balanced
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🔵 Needs a closer look
Independent Chinese-language review and installed validation of VS Code 1.74 compatibility, legacy Runtime restoration, and unsupported-locale fallback remain release gates requiring human qualification.
No open issues 🎉
1 resolved since last review
Review effort: Balanced
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.

Java Pack's own UI was English-only even when VS Code used a different display language. This adds Simplified Chinese support and establishes a native localization workflow for additional languages, with English as the source and fallback.
Approach
vscode.l10nin the extension host and bundled@vscode/l10nin all eight webview implementations, including legacy Runtime restoration. Initialize browser localization before rendering through a shared escaped, nonce/CSP-preserving bootstrap using the bundle selected by VS Code. No pack-specific language setting or remote translation lookup.Product names, user content, embedded walkthrough media, SVG/image content, release/tutorial prose and bundled extensions' translations are outside scope. The minimum VS Code version remains
^1.74.0; CI routing, Node versions and permissions are unchanged.Validation
npm test: 106/106 passed.npm run l10n:check: passed catalog invariants and non-mutating extraction-drift checks.npm run build: passed with warnings. The actual packaged VSIX passed catalog, browser-asset, link/icon/placeholder and synthetic-fallback audits.The Chinese AutoTest plan validates, but the runner's locale/attach forwarding did not launch Chinese. Chinese GUI observations above come from a separate supported normal-GUI attempt, not a passing Chinese AutoTest run. GUI prompt dismissal returning
undefinedand Install JDK Other-tab switching were not qualified.Remaining release gates
java.runtimecommand opens Project Settings instead.Fixes #1790