Skip to content

Add Simplified Chinese translation - #36

Merged
mihaild merged 4 commits into
mihaild:mainfrom
LingAochuan:i18n-zh-cn
Nov 11, 2026
Merged

mihaild merged 4 commits into
mihaild:mainfrom
LingAochuan:i18n-zh-cn

Conversation

@LingAochuan

@LingAochuan LingAochuan commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

This PR adds Simplified Chinese translations to the existing i18next framework. English remains the default, and Chinese can be selected from the language menu or with ?lang=zh-CN.

The translation covers 1,042 interface messages across the current namespaces, all 110 cards, 84 countries, and nine regions. Card names follow a manually reviewed glossary. It also registers the Chinese locale and plural form, extends the language-switching and structured-log tests, and lets header track groups wrap to keep Chinese labels readable.

The changes retain the upstream interface and include no third-party artwork or bundled fonts. Engine logic, model calculations, and saved-game formats are unchanged. Localized log messages keep their card IDs and hover references, while exported descriptions remain English.

AI assistance

The translations, integration changes, and additional tests were prepared with extensive AI assistance using Codex. I reviewed the card-name glossary and manually tested the Chinese interface. Automated checks cover language switching and English compatibility.

Validation

The following GitHub Actions workflows passed in my fork at commit 9ea6199:

  • Web: native engine, WebAssembly engine, and production UI builds; the full tests/web suite, including catalog, structured-log, and Chromium language-switching checks: 188 passed, 6 warnings.
  • Backend tests: C++ unit tests and invariant fuzzing passed; Python core tests: 668 passed; training tests: 1,562 passed, 35 skipped, 9 warnings. Skipped tests are not counted as verified.
  • Type checking: passed.

Local Chromium checks also covered linked cards and play modes, the Space Race dialog, unchanged position and replay data after switching languages, and a 390px viewport.

The upstream PR workflows currently await maintainer approval to run. The linked results above are for this revision, not the previous implementation.

@mihaild

mihaild commented Nov 9, 2026

Copy link
Copy Markdown
Owner

Thanks!

I redesigned the i18n approach a bit, can you PTAL and submit your translation to https://github.com/mihaild/DeepStruggle/tree/main/web/ui/src/i18n?

@LingAochuan LingAochuan changed the title Add i18n support and optional Simplified Chinese UI Add Simplified Chinese translation Nov 10, 2026
@LingAochuan

LingAochuan commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks for adding the new framework! I've updated this PR to provide the Simplified Chinese catalogs under web/ui/src/i18n/locales/zh-CN. English remains the default.

This is ready for another look whenever you have time. I'd be happy to adjust the translations or integration based on your feedback.

@mihaild

mihaild commented Nov 10, 2026

Copy link
Copy Markdown
Owner

Comments from Claude about translation. I don't speak Chinese, can you please check if they make sense or are hallucinations?

  1. Rules text changed between "may" and "must":
    - # 32 UN Intervention: using the Ops is optional in English but mandatory in Chinese (需加"可以").
    - # 87 The Reformer: "6 Influence may be added" became mandatory.
    - # 106 NORAD: an optional "可" was added; the English effect is mandatory.
  2. Wrong card names:
# English PR has Problem Suggested
31 Red Scare 红色恐怖 Means the Bolsheviks' "Red Terror" 红色恐慌
69 Death Squads 敢死队 Means heroic "dare-to-die" troops; also used in effects.json 行刑队
12 Romanian Abdication 颠覆 Means "subversion" 罗马尼亚国王退位
103 Defectors 背叛者 Means "betrayers" 叛逃者
29 East European Unrest 东欧剧变 The fixed term for 1989 东欧动乱
18 Captured Nazi Scientist 逮捕 Means a police arrest 俘获
  1. Wrong meanings in the UI:
    • Leaderboard "on the board" means "on the leaderboard" but was translated as the game board (codes.thOnBoard 当前棋局, footer.notOnBoard 棋盘上的玩家, codes.showAll).
    • Leaderboard "Flags" means train.py command-line flags but became 效果标记 ("effect markers").
    • links.play 打出 means playing a card; the link is for playing a game against that player.
    • tracks:modal.position 局面 should be 位置 (a square on the space track).
    • result:facts.youPlayed 你执行了美国 reads "you executed the US"; it should say which side you played.
    • page:model.runTitle 训练批次 reads as "batch" in an ML context.
  2. Inconsistent terms:
    • Ops is mostly 行动点数, but it also appears as "N 点行动" (in hud, cards, map, tracks) and as bare 行动.
    • NATO is 北约 in #105 but 北大西洋公约组织 everywhere else.
    • Rollout root has three different names, and horizon has four.
  • Card #108 "draw" became 查看 ("look at").
  • One of the new log tests checks exact Chinese sentences, so it will break on any rewording.

@LingAochuan

Copy link
Copy Markdown
Contributor Author

Thanks for sharing Claude's feedback. I checked the points and pushed fixes. The card names follow the established names in the Chinese version I used, so I left them unchanged. The updates mainly clarify potentially ambiguous rules wording, along with a few UI translation fixes.

@mihaild

mihaild commented Nov 11, 2026

Copy link
Copy Markdown
Owner

Thanks!
Our of curiosity - does Chinese have the same name for red scare (measures US accepted allegedly "in fear" of USSR) and red terror (the policy of Bolsheviks party during Russian civil war - this was an official name)?

@LingAochuan

Copy link
Copy Markdown
Contributor Author

Right, Chinese distinguishes them: Red Scare is “红色恐慌”, while Red Terror is “红色恐怖”.

The words “恐慌” and “恐怖” are similar in meaning, but the historical terms refer to different things. The Chinese card edition I used translates Red Scare as “红色恐怖”, and I followed that wording to keep the card names familiar to players.

I’ve reconsidered this particular name. “红色恐慌/清洗” would be more accurate. Thanks for pointing out the distinction.

@mihaild
mihaild merged commit 2d3b68c into mihaild:main Nov 11, 2026
6 of 12 checks passed
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