Add Simplified Chinese language support - #15
Merged
Merged
Conversation
The whole game can now run in English or Simplified Chinese.
- new deepwolf/i18n.py: a Translator with a message catalogue covering every
event, role name, role summary and faction label in en + zh.
- engine.py: all player-facing event text now goes through the Translator;
English output is byte-for-byte unchanged.
- GameConfig gains a validated `lang` field; PlayerView carries `lang`.
- prompts/templates.py: bilingual LLM prompts; the ACTION trailer carries the
language so the offline mock answers in the right tongue.
- agents: RandomAgent and MockProvider produce localised statements.
- cli.py: a --lang {en,zh} flag on `simulate` and `play`; localised outcome.
- adds README.zh-CN.md and 9 new tests.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Owner
Author
|
Code review (post-merge record).
Adding a third language is now just another column in the catalogue. Merged via squash. |
This was referenced May 18, 2026
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.
Summary
Adds Simplified Chinese support — the whole game (event log, roles, agent
speech, CLI) can now run in English or Chinese. Requested by the project owner.
Changes
deepwolf/i18n.py— aTranslatorwith an en/zh message cataloguecovering every game event, role name, role summary and faction label. It is a
leaf module (imports nothing else from deepwolf).
engine.py— all player-facing event text now flows through theTranslator.English output is byte-for-byte unchanged (the reproducibility tests still
pass without modification).
GameConfiggains a validatedlangfield;PlayerViewcarrieslang.prompts/templates.py— bilingual LLM prompts (system message, asks, formatinstructions). The
[[ACTION ...]]trailer now carrieslang=so the offlineMockProvideranswers in the right language; JSON reply keys stay English.RandomAgentandMockProvideremit localised statements.cli.py— a--lang {en,zh}flag onsimulateandplay; localised outcomepanel.
README.zh-CN.mdand links it from the English README.Checklist
ruff check .passesmypy deepwolfpassespytestpasses (60 tests; 9 new for i18n)CHANGELOG.mdandREADME.mdupdatedNotes for reviewers
The design keeps i18n out of the hot path: the engine holds one
Translatorand English strings are identical to before, so no existing game, transcript or
seed changes behaviour. Adding a third language is just another column in the
i18n.pycatalogue.