sisyo 1.6.8 → 1.8.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.
- package/LICENSE +16 -16
- package/README.md +167 -162
- package/bin/known-hashes.json +100 -7
- package/package.json +1 -1
- package/templates/.claude/rules/agents-and-tests.md +32 -0
- package/templates/.claude/rules/docs.md +19 -19
- package/templates/.claude/skills/fastapi-best-practices/ASYNC-PATTERNS.md +121 -121
- package/templates/.claude/skills/fastapi-best-practices/DATABASE.md +153 -153
- package/templates/.claude/skills/fastapi-best-practices/DEPENDENCIES.md +140 -140
- package/templates/.claude/skills/fastapi-best-practices/PROJECT-STRUCTURE.md +90 -90
- package/templates/.claude/skills/fastapi-best-practices/PYDANTIC-GUIDE.md +155 -155
- package/templates/.claude/skills/fastapi-best-practices/SKILL.md +123 -123
- package/templates/.claude/skills/g6-style/SKILL.md +125 -0
- package/templates/.claude/skills/g6-style/references/checks.md +58 -0
- package/templates/.claude/skills/g6-style/references/imagery.md +103 -0
- package/templates/.claude/skills/g6-style/references/motion.md +121 -0
- package/templates/.claude/skills/g6-style/references/sections.md +263 -0
- package/templates/.claude/skills/g6-style/references/tokens.md +197 -0
- package/templates/.claude/skills/hindsight/SKILL.md +175 -172
- package/templates/.claude/skills/hoang-auth/SKILL.md +188 -0
- package/templates/.claude/skills/html-docs/SKILL.md +207 -207
- package/templates/.claude/skills/i18n-multilang/SKILL.md +153 -0
- package/templates/.claude/skills/i18n-multilang/assets/languages.json +47 -0
- package/templates/.claude/skills/i18n-multilang/assets/plural-vectors.json +46 -0
- package/templates/.claude/skills/i18n-multilang/assets/project/README.md +17 -0
- package/templates/.claude/skills/i18n-multilang/assets/project/gitattributes.txt +6 -0
- package/templates/.claude/skills/i18n-multilang/assets/project/gitignore.txt +4 -0
- package/templates/.claude/skills/i18n-multilang/assets/project/glossary.json +6 -0
- package/templates/.claude/skills/i18n-multilang/assets/project/i18n.config.json +22 -0
- package/templates/.claude/skills/i18n-multilang/assets/project/locales/__source__/common.json +10 -0
- package/templates/.claude/skills/i18n-multilang/assets/project/notes/common.json +5 -0
- package/templates/.claude/skills/i18n-multilang/assets/project/style.md +20 -0
- package/templates/.claude/skills/i18n-multilang/references/format.md +100 -0
- package/templates/.claude/skills/i18n-multilang/references/languages.md +97 -0
- package/templates/.claude/skills/i18n-multilang/references/layout-and-versioning.md +256 -0
- package/templates/.claude/skills/i18n-multilang/references/numbers.md +161 -0
- package/templates/.claude/skills/i18n-multilang/references/platform-unity.md +142 -0
- package/templates/.claude/skills/i18n-multilang/references/platform-web.md +107 -0
- package/templates/.claude/skills/i18n-multilang/references/translation.md +143 -0
- package/templates/.claude/skills/i18n-multilang/references/voice.md +271 -0
- package/templates/.claude/skills/i18n-multilang/scripts/i18n.py +1041 -0
- package/templates/.claude/skills/i18n-multilang/scripts/numwords.py +1013 -0
- package/templates/.claude/skills/i18n-multilang/scripts/voice.py +478 -0
- package/templates/.claude/skills/react-page-oriented/SKILL.md +407 -407
- package/templates/.claude/skills/react-page-oriented/triggers.md +12 -12
- package/templates/.claude/skills/terraform-best-practices/SKILL.md +341 -341
- package/templates/.claude/skills/typesafe-jev/SKILL.md +148 -148
- package/templates/.claude/skills/vibe-docs/SKILL.md +242 -242
- package/templates/SISYO.md +37 -37
- package/templates/docs/99_progress/features.md +7 -7
- package/templates/docs/99_progress/handoff.md +19 -19
- package/templates/docs/99_progress/todo.md +15 -15
- package/templates/docs/MAP.md +26 -26
|
@@ -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
|
+
{
|
|
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,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`.
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# Languages: which ones, when they show, how one is chosen
|
|
2
|
+
|
|
3
|
+
The registry is `assets/languages.json` (code, English name, native name, script, direction, plural forms, voice,
|
|
4
|
+
rendering needs, aliases, fallback). `python scripts/i18n.py languages` prints it with the project's view.
|
|
5
|
+
|
|
6
|
+
## The two sets
|
|
7
|
+
|
|
8
|
+
| Set | Languages | Rule |
|
|
9
|
+
|---|---|---|
|
|
10
|
+
| **Text (default)** | 40: en, ja, es, pt-BR, ko, zh-Hans, de, fr, vi, id, zh-Hant, it, ru, tr, pl, nl, th, uk, cs, sv, da, nb, fi, el, hu, ro, sk, hr, bg, ca, ms, fil, hi, bn, ta, ar, he, fa, ur, pt-PT | every product translates its text into all of them, minus what its renderer cannot show (below). |
|
|
11
|
+
| **Voice** | 10: en, ja, es, pt-BR, ko, zh-Hans, de, fr, vi, id | the default voice set, the languages a voice backend is expected to cover. Voice is made only for the languages **and** lines a product names ([voice.md](voice.md)) |
|
|
12
|
+
|
|
13
|
+
Codes are BCP-47: language, then script or region where it matters (`zh-Hans`, `zh-Hant`, `pt-BR`, `pt-PT`). Use
|
|
14
|
+
exactly these codes in folders, config, manifests, settings and on the wire. Legacy codes are mapped, never stored:
|
|
15
|
+
`jp`→`ja`, `iw`→`he`, `in`→`id`, `tl`→`fil`, `no`→`nb`, `zh-CN`→`zh-Hans`, `zh-TW`→`zh-Hant`.
|
|
16
|
+
|
|
17
|
+
A language outside the registry (a new market) is added in the project's `extraLanguages` with the same fields, or to
|
|
18
|
+
the registry itself when every product should get it. Take the plural forms from
|
|
19
|
+
`new Intl.PluralRules(code).resolvedOptions().pluralCategories`.
|
|
20
|
+
|
|
21
|
+
## What the renderer can show: `capabilities`
|
|
22
|
+
|
|
23
|
+
Some scripts need more than glyphs. A language that needs a capability the project has not declared is `blocked`: it
|
|
24
|
+
is not translated, not packed, not offered. Declaring a capability is a claim that was **tested with a screenshot**.
|
|
25
|
+
|
|
26
|
+
| Capability | Needed by | What it means |
|
|
27
|
+
|---|---|---|
|
|
28
|
+
| `rtl` | ar, he, fa, ur | right-to-left paragraphs, mirrored layout, bidirectional text with numbers and Latin words |
|
|
29
|
+
| `shaping` | ar, fa, ur, hi, bn, ta, th | letters join or reorder, marks stack (OpenType GSUB/GPOS). Without it the text is wrong, not just ugly |
|
|
30
|
+
|
|
31
|
+
| Platform | `capabilities` |
|
|
32
|
+
|---|---|
|
|
33
|
+
| Web (browser), Electron, native iOS/Android text, React Native, Flutter | `["rtl", "shaping"]`; RTL still needs the layout checked (`dir="rtl"`, logical CSS properties) |
|
|
34
|
+
| Unity uGUI legacy `Text`, TextMeshPro without a plugin | `[]` → 32 languages (the 8 above stay blocked) |
|
|
35
|
+
| Unity with a shaping solution (UI Toolkit's Advanced Text Generator in Unity 6, or an RTL/HarfBuzz plugin) | declare what a screenshot test of real sentences proves |
|
|
36
|
+
|
|
37
|
+
Fonts are a separate matter from shaping: CJK, Cyrillic, Greek and Thai glyphs must exist in a font the product ships
|
|
38
|
+
or can fall back to. Per script, the Noto family is the safe default (Noto Sans JP / KR / SC / TC / Thai / Devanagari /
|
|
39
|
+
Bengali / Tamil / Arabic / Hebrew; Latin, Greek and Cyrillic are in Noto Sans). See the platform file for how each
|
|
40
|
+
runtime loads them.
|
|
41
|
+
|
|
42
|
+
## When a language appears in the app
|
|
43
|
+
|
|
44
|
+
A language is offered only when its manifest entry says `status: "ready"`: every text is translated and current. A `partial` language is packed (so a user who already chose it keeps it
|
|
45
|
+
and gets fallbacks for the gaps) but is not listed for new users.
|
|
46
|
+
|
|
47
|
+
This is why translating belongs to the feature: adding one untranslated text turns 39 languages `partial`, and
|
|
48
|
+
`pack` refuses to write that regression.
|
|
49
|
+
|
|
50
|
+
## The language picker
|
|
51
|
+
|
|
52
|
+
- A searchable list (type-ahead), one row per ready language: **`<English name> (<native name>)`**, for example
|
|
53
|
+
`Japanese (日本語)`, `Vietnamese (Tiếng Việt)`. Both names come from the manifest.
|
|
54
|
+
- The search matches the English name, the native name and the code, ignoring case and accents: "tieng viet" finds
|
|
55
|
+
Tiếng Việt; "japan", "ja" and "日本" find Japanese.
|
|
56
|
+
- Order: the device's languages first, then the current one, then the rest by English name.
|
|
57
|
+
- Each row shows its state: in the app / downloaded / needs download with the size. Changing language applies
|
|
58
|
+
immediately, without a restart, and is saved.
|
|
59
|
+
- The control that opens the picker carries a globe icon and the word "Language" in the current language **and** in
|
|
60
|
+
English, so someone who landed in a language they cannot read finds the way back.
|
|
61
|
+
- Voice, where a product has it, is a second setting ("Voice: …") that lists only the voice languages that product
|
|
62
|
+
ships. It defaults to the text language when that has voice, else to the product's `voice.fallback`.
|
|
63
|
+
|
|
64
|
+
## The default language on first launch
|
|
65
|
+
|
|
66
|
+
1. Read the device's **ordered list** of preferred languages (iOS `Locale.preferredLanguages`, Android `LocaleList`,
|
|
67
|
+
browser `navigator.languages`). Unity's `Application.systemLanguage` gives one coarse value and cannot tell
|
|
68
|
+
`pt-BR` from `pt-PT` or `zh-Hans` from `zh-Hant`: use it only as the last resort.
|
|
69
|
+
2. For each device language in order, take the first ready language that matches by: exact code → `aliases` → same
|
|
70
|
+
language and script (`zh-Hant-HK` → `zh-Hant`) → same base language (`es-MX` → `es`, `fr-CA` → `fr`).
|
|
71
|
+
3. Nothing matched → `en`; no English → the source language.
|
|
72
|
+
4. Save the choice. From then on only the user changes it. An app update never changes a saved language.
|
|
73
|
+
|
|
74
|
+
Stores read the supported languages from the build: list the ready languages in iOS `CFBundleLocalizations` and
|
|
75
|
+
Android `locales_config` / `resConfigs`, so the store page and the per-app language setting show them.
|
|
76
|
+
|
|
77
|
+
## Fallback for a missing text
|
|
78
|
+
|
|
79
|
+
`active language → its fallback list → source language → the key`. The manifest's `fallback` list is the registry's
|
|
80
|
+
(`pt-PT → pt-BR`, `ca → es`) followed by `en` and the source language. Never fall back across unrelated languages
|
|
81
|
+
(Ukrainian does not fall back to Russian, Traditional Chinese does not fall back to Simplified).
|
|
82
|
+
|
|
83
|
+
## Plural forms per language
|
|
84
|
+
|
|
85
|
+
| Forms | Languages |
|
|
86
|
+
|---|---|
|
|
87
|
+
| other | ja, ko, zh-Hans, zh-Hant, vi, id, th, ms |
|
|
88
|
+
| one, other | en, de, nl, sv, da, nb, fi, el, hu, tr, bg, fil, hi, bn, ta, fa, ur |
|
|
89
|
+
| one, many, other | es, pt-BR, pt-PT, fr, it, ca (`many` is used for exact millions: give it the `other` wording) |
|
|
90
|
+
| one, few, other | ro, hr |
|
|
91
|
+
| one, few, many, other | ru, uk, pl, cs, sk |
|
|
92
|
+
| one, two, other | he |
|
|
93
|
+
| zero, one, two, few, many, other | ar |
|
|
94
|
+
|
|
95
|
+
On the web `Intl.PluralRules` picks the form. A runtime without it ports `plural_category()` from `scripts/i18n.py`
|
|
96
|
+
and tests itself against `assets/plural-vectors.json` (taken from ICU). "one" is not always the number 1: in French
|
|
97
|
+
and Brazilian Portuguese it is 0 and 1; in Russian it is 1, 21, 31…
|