Skip to content

Add Simplified Chinese (zh-CN) translation#90

Merged
brunoborges merged 7 commits intomainfrom
copilot/translate-site-content-chinese
Feb 26, 2026
Merged

Add Simplified Chinese (zh-CN) translation#90
brunoborges merged 7 commits intomainfrom
copilot/translate-site-content-chinese

Conversation

Copy link
Contributor

Copilot AI commented Feb 26, 2026

Adds full Simplified Chinese (Mandarin) locale support across all site layers — UI strings, content translations, and locale registry.

Changes

Locale registry

  • html-generators/locales.properties — added zh-CN=中文 (简体); the generator picks this up to build site/zh-CN/ and inject the locale into the language selector dropdown

UI strings

  • translations/strings/zh-CN.yaml — all 60+ keys translated (nav, sections, filters, search, footer, difficulty labels, copy button, stats, untranslated banner, etc.)

Content translations

  • translations/content/zh-CN/ — 112 partial YAML files covering all 11 categories (language, collections, strings, streams, concurrency, io, errors, datetime, security, tooling, enterprise)

Each content file includes only the translatable fields (title, oldApproach, modernApproach, summary, explanation, whyModernWins, support.description). Structural fields (slug, id, oldCode, modernCode, docs, navigation, etc.) are intentionally absent — they are always sourced from the English baseline at build time.

Sample translation file:

# translations/content/zh-CN/language/type-inference-with-var.yaml
---
title: 使用 var 进行类型推断
oldApproach: 显式类型声明
modernApproach: var 关键字
summary: "使用 var 进行局部变量类型推断——减少噪音,同样安全。"
explanation: "自 Java 10 起,编译器从右侧表达式推断局部变量类型..."
whyModernWins:
- icon: 
  title: 减少样板代码
  desc: "无需在赋值两侧重复复杂的泛型类型。"
...
support:
  description: 自 JDK 10 起广泛可用(2018 年 3 月)

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • api.foojay.io
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java -classpath /tmp/jbang/bin/jbang.jar dev.jbang.Main html-generators/generate.java --locale zh-CN /opt/pipx_bin/git tor.yaml thub.io/javaevolshow /home/REDACTED/.ca4dd53be127a9a69999809f51261f505e5f5daad2:translations/content/zh-CN/streams/virtual-thread-executor.yaml git show�� -CN/streams/predicate-not.yaml sh k/_temp/ghcca-node/node/bin/git mitive-types-in-bash thub.io/javaevol--norc /usr/bin/bash git (dns block)
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java -classpath /tmp/jbang/bin/jbang.jar dev.jbang.Main jdk install 25 /usr/sbin/git rded-patterns.yagit (dns block)
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java -classpath /tmp/jbang/bin/jbang.jar dev.jbang.Main html-generators/generate.java --locale zh-CN ash am-tolist.yaml git it bash /tmp�� -CN/streams/optional-ifpresentorelse.yaml git rgo/bin/git -CN/language/seagit git es ls (dns block)
  • sh.jbang.dev
    • Triggering command: /usr/bin/curl curl -Ls REDACTED git show�� -CN/language/module-import-declarations.yaml git k/_temp/ghcca-node/node/bin/git aml --local e git show�� -CN/language/switch-expressions.yaml git ptables pact-canonical-cgit refs/heads/main /usr/sbin/git git (dns block)
    • Triggering command: /usr/bin/curl curl -Ls REDACTED git show�� -CN/language/pattern-matching-instanceof.yaml git cal/bin/git ng.yaml --local /usr/local/bin/g4dd53be127a9a69999809f51261f505e5f5daad2:translations/content/zh-CN/streams/collectors-flatmapping.yaml git show�� -CN/language/type-inference-with-var.yaml git ash yaml (dns block)
    • Triggering command: /usr/bin/curl curl -Ls REDACTED -o /tmp/install-jbang.sh -CN/language/record-patterns.yaml git /usr/bin/git ml user.name /usr/bin/head git show�� -CN/security/pem-encoding.yaml head git elete (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Translate site content to Chinese (Mandarin)

Created from Copilot CLI via the copilot delegate command.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI and others added 3 commits February 26, 2026 02:58
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Create 29 Simplified Chinese (zh-CN) YAML translation files:
- security: key-derivation-functions, pem-encoding, random-generator,
  strong-random, tls-default (5 files)
- tooling: aot-class-preloading, built-in-http-server, compact-object-headers,
  jfr-profiling, jshell-prototyping, junit6-with-jspecify, multi-file-source,
  single-file-execution (8 files)
- enterprise: ejb-timer-vs-jakarta-scheduler, ejb-vs-cdi,
  jdbc-resultset-vs-jpa-criteria, jdbc-vs-jooq, jdbc-vs-jpa,
  jndi-lookup-vs-cdi-injection, jpa-vs-jakarta-data,
  jsf-managed-bean-vs-cdi-named, manual-transaction-vs-declarative,
  mdb-vs-reactive-messaging, servlet-vs-jaxrs,
  singleton-ejb-vs-cdi-application-scoped, soap-vs-jakarta-rest,
  spring-api-versioning, spring-null-safety-jspecify,
  spring-xml-config-vs-annotations (16 files)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Fix unescaped double quotes inside a double-quoted YAML string
in the first whyModernWins entry's desc field.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI changed the title [WIP] Translate site content to Chinese (Mandarin) Add Simplified Chinese (zh-CN) translation Feb 26, 2026
@brunoborges brunoborges marked this pull request as ready for review February 26, 2026 03:38
@brunoborges brunoborges merged commit c104488 into main Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants