sisyo 1.6.7 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/README.md +6 -1
  2. package/bin/known-hashes.json +109 -0
  3. package/bin/sisyo.js +285 -285
  4. package/package.json +30 -30
  5. package/templates/.claude/rules/agents-and-tests.md +24 -0
  6. package/templates/.claude/skills/g6-style/SKILL.md +125 -0
  7. package/templates/.claude/skills/g6-style/references/checks.md +58 -0
  8. package/templates/.claude/skills/g6-style/references/imagery.md +103 -0
  9. package/templates/.claude/skills/g6-style/references/motion.md +121 -0
  10. package/templates/.claude/skills/g6-style/references/sections.md +263 -0
  11. package/templates/.claude/skills/g6-style/references/tokens.md +197 -0
  12. package/templates/.claude/skills/hindsight/SKILL.md +13 -10
  13. package/templates/.claude/skills/i18n-multilang/SKILL.md +153 -0
  14. package/templates/.claude/skills/i18n-multilang/assets/languages.json +47 -0
  15. package/templates/.claude/skills/i18n-multilang/assets/plural-vectors.json +46 -0
  16. package/templates/.claude/skills/i18n-multilang/assets/project/README.md +17 -0
  17. package/templates/.claude/skills/i18n-multilang/assets/project/gitattributes.txt +6 -0
  18. package/templates/.claude/skills/i18n-multilang/assets/project/gitignore.txt +4 -0
  19. package/templates/.claude/skills/i18n-multilang/assets/project/glossary.json +6 -0
  20. package/templates/.claude/skills/i18n-multilang/assets/project/i18n.config.json +22 -0
  21. package/templates/.claude/skills/i18n-multilang/assets/project/locales/__source__/common.json +10 -0
  22. package/templates/.claude/skills/i18n-multilang/assets/project/notes/common.json +5 -0
  23. package/templates/.claude/skills/i18n-multilang/assets/project/style.md +20 -0
  24. package/templates/.claude/skills/i18n-multilang/references/format.md +100 -0
  25. package/templates/.claude/skills/i18n-multilang/references/languages.md +97 -0
  26. package/templates/.claude/skills/i18n-multilang/references/layout-and-versioning.md +256 -0
  27. package/templates/.claude/skills/i18n-multilang/references/numbers.md +161 -0
  28. package/templates/.claude/skills/i18n-multilang/references/platform-unity.md +142 -0
  29. package/templates/.claude/skills/i18n-multilang/references/platform-web.md +107 -0
  30. package/templates/.claude/skills/i18n-multilang/references/translation.md +143 -0
  31. package/templates/.claude/skills/i18n-multilang/references/voice.md +271 -0
  32. package/templates/.claude/skills/i18n-multilang/scripts/i18n.py +1041 -0
  33. package/templates/.claude/skills/i18n-multilang/scripts/numwords.py +1013 -0
  34. package/templates/.claude/skills/i18n-multilang/scripts/voice.py +478 -0
  35. package/templates/.claude/skills/neon-game-ui-ux-skill/COMPONENTS.md +490 -0
  36. package/templates/.claude/skills/neon-game-ui-ux-skill/GAMIFICATION.md +246 -0
  37. package/templates/.claude/skills/neon-game-ui-ux-skill/ICONS.md +249 -0
  38. package/templates/.claude/skills/neon-game-ui-ux-skill/LAYOUT-NAV.md +362 -0
  39. package/templates/.claude/skills/neon-game-ui-ux-skill/MOTION-A11Y.md +168 -0
  40. package/templates/.claude/skills/neon-game-ui-ux-skill/SKILL.md +137 -0
  41. package/templates/.claude/skills/neon-game-ui-ux-skill/TOKENS.md +323 -0
  42. package/templates/SISYO.md +1 -1
@@ -0,0 +1,153 @@
1
+ ---
2
+ name: i18n-multilang
3
+ description: One standard for multi-language text (and, only where a product has it, voice) across games, apps and websites - i18next-format JSON in a fixed i18n/ folder, AI translation into a default set of 40 languages, language packs with versions that ship inside the app and/or on a CDN (S3 + CloudFront); optional voice in 10 languages for the lines the owner names, with its own version next to the text version, and numbers that a TTS voice always reads correctly. Use this skill whenever work touches text a user reads or hears - adding or changing any user-facing string, translate, localization, i18n, l10n, "đa ngôn ngữ", "thêm ngôn ngữ", "dịch", a language picker or default language, language packs or their versions, voice lines, TTS, "giọng đọc", "đọc số" - and before writing a new user-facing string, even when the request never mentions translation.
4
+ license: MIT
5
+ metadata:
6
+ author: HoangThang
7
+ ---
8
+
9
+ # Multi-language text and voice
10
+
11
+ One standard for all of a team's games, apps and websites, so that a language added once works everywhere and every
12
+ agent puts files in the same place. Text is the standard; voice is an option a few products add. "The owner" below
13
+ is whoever decides for the product.
14
+
15
+ `<skill>` below is this folder (`.claude/skills/i18n-multilang` in a project set up with sisyo). The tools need only
16
+ Python 3.8+.
17
+
18
+ ## The standard
19
+
20
+ ### Text: every product
21
+
22
+ 1. **Format**: i18next JSON v4, the portable subset: nested keys, `{{name}}` placeholders, plural keys
23
+ `key_one` / `key_other`. The same files serve the web (i18next) and the games. → [references/format.md](references/format.md)
24
+ 2. **Place**: one `i18n/` folder per product: `locales/<lang>/<ns>.json`, notes, glossary, style, meta, manifest,
25
+ voice. Engine folders only get copies written by `pack`. Code and texts share one repository; audio does not live
26
+ in git. → [references/layout-and-versioning.md](references/layout-and-versioning.md)
27
+ 3. **Source first**: a text is written once, in the project's source language, as a whole sentence with a key. Code
28
+ never glues fragments and never holds a user-facing string without a key.
29
+ 4. **Text languages**: by default all 40 languages of the registry, minus those the product's text renderer cannot
30
+ show (right-to-left and complex scripts stay blocked until the platform proves it can render them). A language is
31
+ offered to users only when it is `ready`: every text translated and current. → [references/languages.md](references/languages.md)
32
+ 5. **Translation is part of the feature**: the agent translates with the `todo` → `apply` loop, which validates
33
+ placeholders, plural forms, length and forbidden words. A feature that adds text is not done until every language
34
+ is back to `ready`. → [references/translation.md](references/translation.md)
35
+ 6. **Versions**: `pack` builds one pack per language plus a manifest and bumps a language's `version` when its
36
+ content changed. Higher version wins on a device; versions never go down; an existing key never changes meaning.
37
+ 7. **Delivery**: text packs are bundled in the app (they are tiny) **and** published to the product's CDN for updates
38
+ and new languages; hashed file names, manifest uploaded last.
39
+
40
+ ### Voice: optional, and most products have none
41
+
42
+ A product is text-only until the owner names voice languages and lines for it. While `voice.languages` or
43
+ `voice.sets` is empty in its config (the default), **skip rules 8–10 and everything about voice in the references**:
44
+ no voice files, no voice steps, nothing to report about voice.
45
+
46
+ 8. **Opt-in**: only the 10 voice languages, only the languages and line sets the owner named for that product, made
47
+ with the project's own voice backend under that backend's rules, downloaded lazily per set from the CDN.
48
+ → [references/voice.md](references/voice.md)
49
+ 9. **Numbers are never left to the voice**: the spoken text contains no digit (`numwords.py` writes "một nghìn hai
50
+ trăm ba mươi bốn", "một trăm linh năm"), and every clip with a number is checked by a recogniser afterwards.
51
+ → [references/numbers.md](references/numbers.md)
52
+ 10. **Text version and voice version are separate.** A language's text pack and each voice set carry their own
53
+ version, and a voice set records the text version it was packed for; `i18n.py versions` shows both side by
54
+ side. Text may move ahead of voice. When a voiced line's text changes before its clip is remade: the same words
55
+ (only punctuation or case changed) → the clip stays valid; a small rewording the old words still fit →
56
+ `voice.py keep`, the old clip keeps playing and the line counts as `behind` until remade; anything else → the
57
+ line is silent until the new clip exists. A clip that says a different number is never kept.
58
+ → [references/voice.md](references/voice.md) §5
59
+
60
+ ## Find your task
61
+
62
+ | The task | Steps | Read first |
63
+ |---|---|---|
64
+ | A feature added, changed or removed user-facing text | the everyday loop below | format.md |
65
+ | Set up i18n in a new product | `i18n.py init`, fill `style.md` and the config, wire the runtime | layout-and-versioning.md + the platform file |
66
+ | Bring an existing product to the standard | plan it as its own approved batch; convert files, `stamp`, then the runtime | format.md (legacy formats), platform-unity.md §7 or platform-web.md |
67
+ | Translate / add a language | `status` → `todo` → translate → `apply` → `check` | translation.md, languages.md |
68
+ | Language picker, default language, fallback | implement the contract | languages.md + the platform file |
69
+ | Runtime loading, updates from the CDN | implement the contract | layout-and-versioning.md §9, platform file |
70
+ | Publish packs | `pack`, upload in plan order, verify | layout-and-versioning.md §7–8 |
71
+ | Voice lines for a product | only if the owner named languages and lines: `voice.py plan` → sample → bulk → `add` → `pack` | voice.md, numbers.md |
72
+ | A voice reads a number wrong | fix the spoken text with `numwords.py`, regenerate, check with `heard` | numbers.md |
73
+
74
+ Platform files: [references/platform-unity.md](references/platform-unity.md) (runtime contract, fonts, tests,
75
+ adopting the standard in an existing game), [references/platform-web.md](references/platform-web.md) (i18next setup,
76
+ language matching code, SEO, apps).
77
+
78
+ ## The everyday loop: a feature touched text
79
+
80
+ ```bash
81
+ python <skill>/scripts/i18n.py status # 1. see the state before you start
82
+ # 2. write the new texts in i18n/locales/<source>/<ns>.json (whole sentences, {{named}} values, plural keys for
83
+ # counts) and a note in i18n/notes/<ns>.json for anything short or ambiguous; use the keys in code
84
+ python <skill>/scripts/i18n.py status # 3. every other language now shows new / stale texts
85
+ python <skill>/scripts/i18n.py todo --lang en --out <scratch>/todo.en.json # 4. per language: translate the
86
+ python <skill>/scripts/i18n.py apply <scratch>/done.en.json # answer file, apply; English first
87
+ python <skill>/scripts/i18n.py check # 5. no errors; read the warnings
88
+ python <skill>/scripts/i18n.py pack # 6. packs + manifest + bundle copies; versions bump
89
+ # 7. only if the product has voice (voice.languages and voice.sets are set):
90
+ python <skill>/scripts/voice.py plan # lines that became new, stale or blocked; shows "clip says / text now"
91
+ python <skill>/scripts/voice.py say --lang L --id ns:key "…" # settle blocked lines (or fix their shown text)
92
+ python <skill>/scripts/voice.py keep --lang L --id ns:key --why "…" # a stale line whose old words still fit
93
+ python <skill>/scripts/voice.py pack # always, after i18n.py pack: voice version, behind and silent lines
94
+ python <skill>/scripts/i18n.py versions # text version and voice version side by side
95
+ # new clips need the voice server and its rules (voice.md): report the lines to make, with their spoken text
96
+ # 8. commit i18n/ and the bundle copies together with the code. Publishing to the CDN is a separate, approved step.
97
+ ```
98
+
99
+ - Reworded text, same meaning: edit in place (translations go stale and are redone). Different meaning or different
100
+ placeholders: a **new key**. Deleted text: remove it from the source, then `i18n.py sync --write`.
101
+ - `pack` refuses when a language that was `ready` no longer is. That refusal is the reminder to translate, not an
102
+ obstacle to bypass: `--allow-regress` is for the owner's explicit decision.
103
+ - With 40 languages, give each language (or small group) to a sub-agent running the same loop; `check` and `pack`
104
+ once at the end.
105
+ - A text the product speaks aloud (`"voice": true` in `todo`): write numbers as plain digits without a grouping mark
106
+ (`1500`). Changing its wording leaves its clip one step behind the text: decide per line whether the old clip
107
+ still fits (`keep`) or the line must wait for a new clip, and report both lists to the owner before anything is
108
+ published.
109
+ - Keep `todo` / answer files outside the repository (a scratch folder).
110
+ - A project not yet on the standard: follow its existing localisation docs for the change at hand, keep to rules 3
111
+ and 5 in spirit (source text first, all shipped languages translated), and do not half-migrate in passing.
112
+
113
+ ## Tools
114
+
115
+ | Command | What it does |
116
+ |---|---|
117
+ | `i18n.py init --product P --source vi` | scaffold `i18n/` |
118
+ | `i18n.py status [--json]` | per language: ready / partial / blocked, what is new, stale, incomplete |
119
+ | `i18n.py todo --lang L [--ns a,b] [--limit N] [--out F]` | the texts to translate, with reference, notes, glossary, plural forms |
120
+ | `i18n.py apply F [--lock] [--force]` | merge an answer file; rejects broken items with the reason |
121
+ | `i18n.py check [--lang L] [--strict]` | validate everything; exit 1 on errors |
122
+ | `i18n.py pack [--allow-regress] [--no-bundle]` | build `dist/`, `manifest.json`, bundle copies, upload plan |
123
+ | `i18n.py sync [--write]` | remove keys the source no longer has |
124
+ | `i18n.py stamp --lang L \| --all` | adopt existing translations as current |
125
+ | `i18n.py languages` | the registry and this project's view of it |
126
+ | `i18n.py versions [--json]` | per language: text version and state; voice version, the text version it was packed for, clips behind and silent |
127
+ | `voice.py plan [--lang L --out F]` | voice lines: ready, behind, new, stale, blocked; the list to synthesise with spoken text and numbers |
128
+ | `voice.py say --lang L --id ns:key "…"` | write a line's spoken text by hand, tied to its shown text and checked for its numbers |
129
+ | `voice.py keep --lang L --id ns:key… [--why "…"] [--undo]` | the text changed a little: the old clip keeps playing until remade (refused when a number changed) |
130
+ | `voice.py add --lang L --map F` | register checked clips |
131
+ | `voice.py pack` | voice sets, voice manifest, upload plan; only current clips go in |
132
+ | `numwords.py spell N --lang L \| --all`, `speak`, `heard`, `selftest` | numbers as words; digits in a text → words; was the number said |
133
+
134
+ All of them find `i18n.config.json` from the current folder (or take `--config`). Files in `meta/`, both
135
+ `manifest.json` files and the bundle copies are written by the tools only.
136
+
137
+ ## Ask the owner before
138
+
139
+ - adding a voice language or a voice set to a product, and before any bulk voice run (a listening sample comes first);
140
+ - publishing to a production CDN for the first time, applying Terraform, changing bucket or cache policy;
141
+ - `pack --allow-regress`, removing a language users already have, `apply --force` on a locked text;
142
+ - declaring `rtl` / `shaping` for a platform, or adding a language that is not in the registry;
143
+ - using any voice, TTS or translation service other than the ones the project names;
144
+ - bumping `compat`.
145
+
146
+ Never, whatever the task: export or upload a cloned voice's reference recordings or profiles; use a voice-server
147
+ endpoint its rules forbid; print or commit an API key or a private address; hand-edit a manifest or a bundle copy.
148
+
149
+ ## Report honestly
150
+
151
+ When the work is done, say per language what its state is (`status`), what `check` printed, which versions `pack`
152
+ bumped, and what was **not** done (languages left partial, lines blocked, nothing published). "Translated" means
153
+ `apply` accepted it and `check` passes, not that a file was written.
@@ -0,0 +1,47 @@
1
+ {
2
+ "schema": 1,
3
+ "_about": "Language registry of the i18n-multilang skill. 'default': part of the default text set. 'voice': one of the 10 default voice languages. 'plurals': CLDR cardinal categories a plural key must provide. 'requires': text-rendering capabilities the platform must declare in i18n.config.json before the language is offered. 'aliases': device locale codes that map to this language besides its own base code. 'fallback': languages tried before English when a key is missing.",
4
+ "languages": [
5
+ {"code": "en", "name": "English", "native": "English", "script": "Latn", "dir": "ltr", "plurals": ["one", "other"], "default": true, "voice": true},
6
+ {"code": "ja", "name": "Japanese", "native": "日本語", "script": "Jpan", "dir": "ltr", "plurals": ["other"], "default": true, "voice": true},
7
+ {"code": "es", "name": "Spanish", "native": "Español", "script": "Latn", "dir": "ltr", "plurals": ["one", "many", "other"], "default": true, "voice": true},
8
+ {"code": "pt-BR", "name": "Portuguese (Brazil)", "native": "Português (Brasil)", "script": "Latn", "dir": "ltr", "plurals": ["one", "many", "other"], "default": true, "voice": true, "aliases": ["pt"]},
9
+ {"code": "ko", "name": "Korean", "native": "한국어", "script": "Kore", "dir": "ltr", "plurals": ["other"], "default": true, "voice": true},
10
+ {"code": "zh-Hans", "name": "Chinese (Simplified)", "native": "简体中文", "script": "Hans", "dir": "ltr", "plurals": ["other"], "default": true, "voice": true, "aliases": ["zh", "zh-CN", "zh-SG", "zh-Hans-CN", "zh-Hans-SG"]},
11
+ {"code": "de", "name": "German", "native": "Deutsch", "script": "Latn", "dir": "ltr", "plurals": ["one", "other"], "default": true, "voice": true},
12
+ {"code": "fr", "name": "French", "native": "Français", "script": "Latn", "dir": "ltr", "plurals": ["one", "many", "other"], "default": true, "voice": true},
13
+ {"code": "vi", "name": "Vietnamese", "native": "Tiếng Việt", "script": "Latn", "dir": "ltr", "plurals": ["other"], "default": true, "voice": true},
14
+ {"code": "id", "name": "Indonesian", "native": "Bahasa Indonesia", "script": "Latn", "dir": "ltr", "plurals": ["other"], "default": true, "voice": true, "aliases": ["in"]},
15
+
16
+ {"code": "zh-Hant", "name": "Chinese (Traditional)", "native": "繁體中文", "script": "Hant", "dir": "ltr", "plurals": ["other"], "default": true, "aliases": ["zh-TW", "zh-HK", "zh-MO", "zh-Hant-TW", "zh-Hant-HK", "zh-Hant-MO"]},
17
+ {"code": "it", "name": "Italian", "native": "Italiano", "script": "Latn", "dir": "ltr", "plurals": ["one", "many", "other"], "default": true},
18
+ {"code": "ru", "name": "Russian", "native": "Русский", "script": "Cyrl", "dir": "ltr", "plurals": ["one", "few", "many", "other"], "default": true},
19
+ {"code": "tr", "name": "Turkish", "native": "Türkçe", "script": "Latn", "dir": "ltr", "plurals": ["one", "other"], "default": true},
20
+ {"code": "pl", "name": "Polish", "native": "Polski", "script": "Latn", "dir": "ltr", "plurals": ["one", "few", "many", "other"], "default": true},
21
+ {"code": "nl", "name": "Dutch", "native": "Nederlands", "script": "Latn", "dir": "ltr", "plurals": ["one", "other"], "default": true},
22
+ {"code": "th", "name": "Thai", "native": "ไทย", "script": "Thai", "dir": "ltr", "plurals": ["other"], "default": true, "requires": ["shaping"]},
23
+ {"code": "uk", "name": "Ukrainian", "native": "Українська", "script": "Cyrl", "dir": "ltr", "plurals": ["one", "few", "many", "other"], "default": true},
24
+ {"code": "cs", "name": "Czech", "native": "Čeština", "script": "Latn", "dir": "ltr", "plurals": ["one", "few", "many", "other"], "default": true},
25
+ {"code": "sv", "name": "Swedish", "native": "Svenska", "script": "Latn", "dir": "ltr", "plurals": ["one", "other"], "default": true},
26
+ {"code": "da", "name": "Danish", "native": "Dansk", "script": "Latn", "dir": "ltr", "plurals": ["one", "other"], "default": true},
27
+ {"code": "nb", "name": "Norwegian", "native": "Norsk bokmål", "script": "Latn", "dir": "ltr", "plurals": ["one", "other"], "default": true, "aliases": ["no", "nn"]},
28
+ {"code": "fi", "name": "Finnish", "native": "Suomi", "script": "Latn", "dir": "ltr", "plurals": ["one", "other"], "default": true},
29
+ {"code": "el", "name": "Greek", "native": "Ελληνικά", "script": "Grek", "dir": "ltr", "plurals": ["one", "other"], "default": true},
30
+ {"code": "hu", "name": "Hungarian", "native": "Magyar", "script": "Latn", "dir": "ltr", "plurals": ["one", "other"], "default": true},
31
+ {"code": "ro", "name": "Romanian", "native": "Română", "script": "Latn", "dir": "ltr", "plurals": ["one", "few", "other"], "default": true},
32
+ {"code": "sk", "name": "Slovak", "native": "Slovenčina", "script": "Latn", "dir": "ltr", "plurals": ["one", "few", "many", "other"], "default": true},
33
+ {"code": "hr", "name": "Croatian", "native": "Hrvatski", "script": "Latn", "dir": "ltr", "plurals": ["one", "few", "other"], "default": true},
34
+ {"code": "bg", "name": "Bulgarian", "native": "Български", "script": "Cyrl", "dir": "ltr", "plurals": ["one", "other"], "default": true},
35
+ {"code": "ca", "name": "Catalan", "native": "Català", "script": "Latn", "dir": "ltr", "plurals": ["one", "many", "other"], "default": true, "fallback": ["es"]},
36
+ {"code": "ms", "name": "Malay", "native": "Bahasa Melayu", "script": "Latn", "dir": "ltr", "plurals": ["other"], "default": true},
37
+ {"code": "fil", "name": "Filipino", "native": "Filipino", "script": "Latn", "dir": "ltr", "plurals": ["one", "other"], "default": true, "aliases": ["tl"]},
38
+ {"code": "hi", "name": "Hindi", "native": "हिन्दी", "script": "Deva", "dir": "ltr", "plurals": ["one", "other"], "default": true, "requires": ["shaping"]},
39
+ {"code": "bn", "name": "Bengali", "native": "বাংলা", "script": "Beng", "dir": "ltr", "plurals": ["one", "other"], "default": true, "requires": ["shaping"]},
40
+ {"code": "ta", "name": "Tamil", "native": "தமிழ்", "script": "Taml", "dir": "ltr", "plurals": ["one", "other"], "default": true, "requires": ["shaping"]},
41
+ {"code": "ar", "name": "Arabic", "native": "العربية", "script": "Arab", "dir": "rtl", "plurals": ["zero", "one", "two", "few", "many", "other"], "default": true, "requires": ["rtl", "shaping"]},
42
+ {"code": "he", "name": "Hebrew", "native": "עברית", "script": "Hebr", "dir": "rtl", "plurals": ["one", "two", "other"], "default": true, "requires": ["rtl"], "aliases": ["iw"]},
43
+ {"code": "fa", "name": "Persian", "native": "فارسی", "script": "Arab", "dir": "rtl", "plurals": ["one", "other"], "default": true, "requires": ["rtl", "shaping"]},
44
+ {"code": "ur", "name": "Urdu", "native": "اردو", "script": "Arab", "dir": "rtl", "plurals": ["one", "other"], "default": true, "requires": ["rtl", "shaping"]},
45
+ {"code": "pt-PT", "name": "Portuguese (Portugal)", "native": "Português (Portugal)", "script": "Latn", "dir": "ltr", "plurals": ["one", "many", "other"], "default": true, "aliases": ["pt-AO", "pt-MZ"], "fallback": ["pt-BR"]}
46
+ ]
47
+ }
@@ -0,0 +1,46 @@
1
+ {
2
+ "_about": "CLDR cardinal plural category of each whole number in numbers, per language, taken from Intl.PluralRules (ICU 77.1, CLDR 47.0). A runtime that ports the plural rules (Unity C#) tests itself against this file.",
3
+ "numbers": [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,19,20,21,22,23,24,25,100,101,102,103,104,105,111,112,113,114,121,122,1000,1001,1000000,2000000],
4
+ "categories": {
5
+ "en": ["other","one","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other"],
6
+ "ja": ["other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other"],
7
+ "es": ["other","one","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","many","many"],
8
+ "pt-BR": ["one","one","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","many","many"],
9
+ "ko": ["other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other"],
10
+ "zh-Hans": ["other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other"],
11
+ "de": ["other","one","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other"],
12
+ "fr": ["one","one","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","many","many"],
13
+ "vi": ["other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other"],
14
+ "id": ["other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other"],
15
+ "zh-Hant": ["other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other"],
16
+ "it": ["other","one","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","many","many"],
17
+ "ru": ["many","one","few","few","few","many","many","many","many","many","many","many","many","many","many","many","many","many","one","few","few","few","many","many","one","few","few","few","many","many","many","many","many","one","few","many","one","many","many"],
18
+ "tr": ["other","one","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other"],
19
+ "pl": ["many","one","few","few","few","many","many","many","many","many","many","many","many","many","many","many","many","many","many","few","few","few","many","many","many","few","few","few","many","many","many","many","many","many","few","many","many","many","many"],
20
+ "nl": ["other","one","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other"],
21
+ "th": ["other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other"],
22
+ "uk": ["many","one","few","few","few","many","many","many","many","many","many","many","many","many","many","many","many","many","one","few","few","few","many","many","one","few","few","few","many","many","many","many","many","one","few","many","one","many","many"],
23
+ "cs": ["other","one","few","few","few","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other"],
24
+ "sv": ["other","one","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other"],
25
+ "da": ["other","one","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other"],
26
+ "nb": ["other","one","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other"],
27
+ "fi": ["other","one","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other"],
28
+ "el": ["other","one","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other"],
29
+ "hu": ["other","one","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other"],
30
+ "ro": ["few","one","few","few","few","few","few","few","few","few","few","few","few","few","few","few","few","other","other","other","other","other","other","other","few","few","few","few","few","few","few","few","few","other","other","other","few","other","other"],
31
+ "sk": ["other","one","few","few","few","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other"],
32
+ "hr": ["other","one","few","few","few","other","other","other","other","other","other","other","other","other","other","other","other","other","one","few","few","few","other","other","one","few","few","few","other","other","other","other","other","one","few","other","one","other","other"],
33
+ "bg": ["other","one","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other"],
34
+ "ca": ["other","one","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","many","many"],
35
+ "ms": ["other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other"],
36
+ "fil": ["one","one","one","one","other","one","other","one","one","other","one","one","one","one","other","one","other","one","one","one","one","other","one","one","one","one","one","other","one","one","one","one","other","one","one","one","one","one","one"],
37
+ "hi": ["one","one","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other"],
38
+ "bn": ["one","one","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other"],
39
+ "ta": ["other","one","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other"],
40
+ "ar": ["zero","one","two","few","few","few","few","few","few","few","few","many","many","many","many","many","many","many","many","many","many","many","many","other","other","other","few","few","few","many","many","many","many","many","many","other","other","other","other"],
41
+ "he": ["other","one","two","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other"],
42
+ "fa": ["one","one","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other"],
43
+ "ur": ["other","one","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other"],
44
+ "pt-PT": ["other","one","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","other","many","many"]
45
+ }
46
+ }
@@ -0,0 +1,17 @@
1
+ # i18n: the texts and voices of __PRODUCT__
2
+
3
+ Managed with the `i18n-multilang` skill (`.claude/skills/i18n-multilang`, installed by sisyo). Agents: load that skill before changing anything here.
4
+
5
+ | Path | What | Edited by |
6
+ |---|---|---|
7
+ | `i18n.config.json` | product, source language, languages, bundle folders, CDN, voice sets | people / agents |
8
+ | `locales/<lang>/<ns>.json` | the texts (i18next JSON). `__SOURCE__` is the source: write new texts there first | source: authors; other languages: `i18n.py apply` |
9
+ | `notes/<ns>.json` | context and length limits for translators | authors |
10
+ | `glossary.json`, `style.md` | names, fixed terms, forbidden words, tone | authors |
11
+ | `meta/<lang>.json` | which source text each translation was made from | `i18n.py` only |
12
+ | `manifest.json` | versions and hashes of the last pack | `i18n.py pack` only |
13
+ | `voice/` (only if the product has voice) | spoken-text overrides (`voice.py say`), clip manifests and the voice manifest with its own versions | `voice.py` only |
14
+ | `dist/`, `voice/_audio/` | build output and audio cache: not in git | tools |
15
+
16
+ After adding or changing a text: `status` → `todo` / translate / `apply` per language → `check` → `pack` → commit.
17
+ `python .claude/skills/i18n-multilang/scripts/i18n.py versions` shows the text version of every language (and the voice version, if any).
@@ -0,0 +1,6 @@
1
+ # LF everywhere: these files are read on Windows, on the Mac and by the CDN, and their hashes must not depend on the OS
2
+ * text=auto eol=lf
3
+ *.mp3 binary
4
+ *.ogg binary
5
+ *.wav binary
6
+ *.m4a binary
@@ -0,0 +1,4 @@
1
+ # built packs and upload plans (rebuilt by "pack")
2
+ dist/
3
+ # generated audio: lives on S3 / the CDN, never in git
4
+ voice/_audio/
@@ -0,0 +1,6 @@
1
+ {
2
+ "_about": "Words every translation must respect. keep: names written the same in every language (brands, characters). terms: a fixed translation per language for a product word. forbidden: words that must never appear ('*' = every language).",
3
+ "keep": [],
4
+ "terms": {},
5
+ "forbidden": {}
6
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "schema": 1,
3
+ "product": "__PRODUCT__",
4
+ "sourceLanguage": "__SOURCE__",
5
+ "referenceLanguage": "en",
6
+ "compat": 1,
7
+ "localesDir": "locales",
8
+ "layout": "{lang}/{ns}.json",
9
+ "languages": "default",
10
+ "exclude": [],
11
+ "capabilities": [],
12
+ "bundle": {
13
+ "languages": "all",
14
+ "copyTo": []
15
+ },
16
+ "dist": "dist",
17
+ "cdn": {
18
+ "baseUrl": "",
19
+ "textPrefix": "i18n",
20
+ "voicePrefix": "voice"
21
+ }
22
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "_about": "Texts shared by every screen. One file per namespace; nested keys; {{name}} placeholders; plural keys end in _one / _other.",
3
+ "app": {
4
+ "name": "__PRODUCT__"
5
+ },
6
+ "action": {
7
+ "ok": "OK",
8
+ "cancel": "Cancel"
9
+ }
10
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "_about": "Context for translators, per key of the namespace: a sentence, or {\"note\": \"…\", \"max\": 12} when the text has a hard length limit.",
3
+ "app.name": "The product name. Do not translate.",
4
+ "action.ok": {"note": "Button that confirms a dialog.", "max": 10}
5
+ }
@@ -0,0 +1,20 @@
1
+ # Translation style: __PRODUCT__
2
+
3
+ Read this before translating. It is the brief every translator (person or agent) works from.
4
+
5
+ ## Product and audience
6
+ - What the product is, in one sentence:
7
+ - Who reads the texts (age, market):
8
+ - Tone (playful, plain, formal…):
9
+
10
+ ## Rules for every language
11
+ - Address the reader as: (informal "you" / polite form…)
12
+ - Names and brands: see `glossary.json` (`keep`). Never translate them.
13
+ - Length: buttons and labels stay close to the source length; a note with `max` in `notes/<ns>.json` is a hard limit.
14
+
15
+ ## Per language
16
+ <!-- Add a line only where a language needs its own rule. Examples:
17
+ - ja: texts for children in kana with spaces between phrases; parent screens in normal Japanese.
18
+ - de: informal "du".
19
+ - ko: 해요체.
20
+ -->
@@ -0,0 +1,100 @@
1
+ # Text format: i18next JSON v4, the portable subset
2
+
3
+ i18next is the most widely used format on the web (`i18next`, `react-i18next`, `next-i18next`). Games and apps read
4
+ the **same files**, so one tool chain and one translation memory serve everything. "Portable subset" means: only the i18next features a small
5
+ game runtime can implement exactly. `i18n.py check` enforces the rules below.
6
+
7
+ ## A locale file
8
+
9
+ `locales/<lang>/<namespace>.json`, UTF-8, LF, 2-space indent. Example `locales/en/shop.json`:
10
+
11
+ ```json
12
+ {
13
+ "_about": "The shop screen. Keys that start with _ at the top level are comments.",
14
+ "title": "Shop",
15
+ "buy": "Buy for {{price}} coins",
16
+ "greeting": "Welcome back, {{name}}!",
17
+ "items_one": "{{count}} item",
18
+ "items_other": "{{count}} items",
19
+ "error": {
20
+ "notEnough": "Not enough coins"
21
+ }
22
+ }
23
+ ```
24
+
25
+ | Element | Rule | Why |
26
+ |---|---|---|
27
+ | Namespace | one file per feature area (`common`, `lobby`, `shop`, `chapter01`); name `[A-Za-z0-9_-]+`. A new screen or feature with more than a handful of texts gets its own file; a few texts that belong to an existing screen go into that screen's file | small diffs, parallel work, lazy loading on the web |
28
+ | Key | nested objects, addressed as `shop:error.notEnough`; parts are `[A-Za-z0-9_-]`, lowerCamelCase; a key is a text **or** a parent, never both | the i18next default; flat dotted keys (`"error.notEnough": "…"`) are also read, but do not mix the two styles in one file |
29
+ | Value | a string. No arrays, numbers, null or objects-as-values | arrays and `returnObjects` do not port |
30
+ | Placeholder | `{{name}}`: letters, digits, `_`. Named, never positional in new texts | translators must know what the value is; word order differs by language |
31
+ | Plural | one key per CLDR form: `key_one`, `key_other` (also `_zero _two _few _many`), selected by the `count` value. The **source needs `_other`**; each language provides exactly its own forms ([languages.md](languages.md)) | i18next JSON v4; `i18n.py apply` rejects a language's answer that lacks a form |
32
+ | Comment | top-level keys starting with `_` (for example `_about`) | ignored by the tools, never packed |
33
+
34
+ A key that ends in `_zero`, `_one`, `_two`, `_few`, `_many` or `_other` is **always** a plural form. Do not end an
35
+ ordinary key that way.
36
+
37
+ ## Not portable: do not use in shared texts
38
+
39
+ | i18next feature | Use instead |
40
+ |---|---|
41
+ | Nesting `$t(other.key)` | repeat the words, or pass the text in as a placeholder |
42
+ | Formatters `{{value, number}}`, `{{date, datetime}}` | format the value in code for the current locale, pass the finished string |
43
+ | Context suffixes (`friend_male`) | two separate keys |
44
+ | Arrays / `returnObjects` | numbered keys (`tip1`, `tip2`) or a namespace |
45
+ | `<1>…</1>` component tags | only in web-only namespaces; tags must match the source |
46
+ | Unescaped HTML in values | never: every runtime prints the text as text |
47
+
48
+ `check` warns about these. A web-only namespace may use them if the product has no game or app runtime.
49
+
50
+ ## Writing source texts (it decides the quality of 40 translations)
51
+
52
+ - **Whole sentences.** Never glue fragments in code (`"You have " + n + " stars"`): word order and agreement differ.
53
+ One key = one complete sentence with placeholders.
54
+ - **One meaning per key.** "Open" (verb) and "Open" (state) are two keys. Reusing a key because the English matches
55
+ breaks other languages.
56
+ - **Anything with a count is a plural key**, even if the source language has one form (Vietnamese, Japanese):
57
+ `stars_other`, with `{{count}}`. Russian needs four forms, Arabic six, and they can only exist if the key is plural.
58
+ - **No text in images**, no text baked into prefabs or HTML without a key.
59
+ - **Give context** in `notes/<ns>.json` for anything short or ambiguous: where it shows, what the placeholder holds, a
60
+ hard length limit. The file is **flat**: each note is keyed by the dotted key without the namespace
61
+ (`"error.notEnough"`), and a plural key by its base name (`"items"`, not `"items_other"`). `check` warns about a
62
+ note whose key matches no text.
63
+
64
+ ```json
65
+ { "buy": {"note": "Button under an item. {{price}} is a whole number.", "max": 22},
66
+ "title": "Screen title.", "items": "{{count}} is how many items are in the bag.", "error.notEnough": "Toast." }
67
+ ```
68
+ - **Names and fixed terms** go in `glossary.json` (`keep`, `terms`, `forbidden`), not into each note.
69
+ - **Numbers the app computes** (scores, prices, counts, dates): the app formats them for the locale and the text only
70
+ has the placeholder.
71
+ - **Numbers that are part of the sentence** (a fixed reward in a story line, "3 steps"): digits in the text are
72
+ fine. Write a whole number below 10,000 **without a grouping mark** (`1500`, not `1.500` or `1,500`): the mark
73
+ means different things in different languages and blocks the voice tool. From 10,000 up, each language uses its
74
+ own grouping (`12.000` vi / `12,000` en / `12 000` fr with a no-break space).
75
+ - **A spoken line** (one the product has voice for) lives where a voice set's pattern selects it: look at
76
+ `voice.sets` in `i18n.config.json` before choosing its namespace and key ([voice.md](voice.md)). A feature's
77
+ screen texts and its spoken lines may therefore sit in different files.
78
+
79
+ ## Changing a text
80
+
81
+ | Change | Do | Effect |
82
+ |---|---|---|
83
+ | New text | add the key in the source language | every language shows it as `missing` until translated |
84
+ | Reword, same meaning | edit the source text in place | translations become `stale` and are redone |
85
+ | Different meaning, or different placeholders | **new key**; delete the old one when the code stops using it | old app versions keep working with their bundled text |
86
+ | Text no longer used | delete it from the source, then `i18n.py sync --write` | removed from every language |
87
+ | Typo in one translation | fix that language's file, or `apply` a corrected answer | stays stamped; `apply --lock` protects a human fix from being overwritten |
88
+
89
+ **Reword or new key?** Ask: is the new text still right in every place, and in every released app version, that
90
+ shows this key? An app released last month will download the new wording into its old screen. A greeting that becomes
91
+ a warmer greeting passes (same place, same role): edit in place. A button that now does something else, a sentence
92
+ that gained or lost a placeholder, or a text reused for a second purpose does not: new key.
93
+
94
+ ## Legacy formats
95
+
96
+ `check` reads single-brace `{name}` and positional `{0}` as placeholders too, and warns that they are legacy, so an
97
+ existing project can be validated before it is converted. Converting is mechanical: move the files into the layout,
98
+ change `{name}` to `{{name}}` in the files and in the runtime's formatter in the same commit (a positional `{0}` may
99
+ become `{{0}}` first, which is a valid name, and get a real name when the text is next touched), check the
100
+ translations that already exist and record them with `i18n.py stamp --all`.