Skip to content

feat: add i18n support with Simplified Chinese (zh-cn) translations - #1038

Open
fangfuzha wants to merge 4 commits into
godotengine:masterfrom
fangfuzha:feat/i18n-chinese-support
Open

feat: add i18n support with Simplified Chinese (zh-cn) translations#1038
fangfuzha wants to merge 4 commits into
godotengine:masterfrom
fangfuzha:feat/i18n-chinese-support

Conversation

@fangfuzha

Copy link
Copy Markdown

Summary

Add internationalization (i18n) support for the extension's configuration settings, with Simplified Chinese (zh-cn) as the first localized language.

Changes

  • package.nls.json (new): Default English locale file containing all 24 configuration string keys (title, descriptions, enum descriptions).
  • package.nls.zh-cn.json (new): Simplified Chinese translation file with all 24 keys fully translated.
  • package.json: Replaced all hardcoded English description strings in contributes.configuration with %key% placeholder references.
  • .vscodeignore: Added !package.nls.zh-cn.json to ensure the Chinese locale file is included in the packaged vsix.

Scope

This PR is focused solely on i18n infrastructure and Chinese translations — no functional code changes, no TypeScript modifications, no behavior changes.

How it works

VS Code automatically loads the appropriate package.nls.<locale>.json based on the user's display language. When locale is zh-cn, all configuration settings descriptions will appear in Chinese; for any other locale, it falls back to the default English strings in package.nls.json.

Co-authored-by: traeagent <traeagent@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 9, 2026 15:45

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds VS Code extension i18n support for configuration strings by introducing default (English) and Simplified Chinese locale files, and wiring contributes.configuration strings in package.json to %key% placeholders so VS Code can render localized settings descriptions.

Changes:

  • Added package.nls.json (default English) containing all configuration title/description/enumDescription strings.
  • Added package.nls.zh-cn.json providing Simplified Chinese translations for the same keys.
  • Updated package.json configuration metadata to reference %config.*% keys, and updated .vscodeignore to include the new locale file in the VSIX.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
package.nls.json Adds default English NLS strings for configuration UI.
package.nls.zh-cn.json Adds zh-cn translations for configuration UI strings.
package.json Replaces hardcoded configuration strings with NLS %key% placeholders.
.vscodeignore Ensures locale files are packaged into the extension VSIX.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread package.nls.json Outdated
Comment thread package.nls.zh-cn.json Outdated
Comment on lines +15 to +16
"config.formatter.spacesBeforeEndOfLineComment.enumDescriptions.1": "行尾注释前留 1 个空格 # 像这样。",
"config.formatter.spacesBeforeEndOfLineComment.enumDescriptions.2": "行尾注释前留 2 个空格 # 像这样。",
Comment thread .vscodeignore Outdated
Comment on lines +10 to +11
!package.nls.json
!package.nls.zh-cn.json
fangfuzha and others added 3 commits July 10, 2026 08:28
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
- Use NBSP (U+00A0) in enum description examples to preserve visual
  spacing of spaces before '#' in VS Code Settings UI (both en and zh-cn)
- Replace per-locale whitelist in .vscodeignore with package.nls*.json
  wildcard pattern for future-proofing
Localize all remaining user-visible strings in package.json:
- customEditors: displayName (1 string)
- commands: category + 27 command titles (28 strings)
- debuggers: label, launch/attach config descriptions, enum
  descriptions, initialConfigurations name, configurationSnippets
  labels and descriptions (30 strings)
- viewsContainers: title (1 string)
- views: 3 view names
- viewsWelcome: 3 welcome contents

Total: 90 localized strings (up from 24). English (package.nls.json)
and Simplified Chinese (package.nls.zh-cn.json) are fully in sync.
No functional code changes.
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.

2 participants