271 lines
27 KiB
Markdown
271 lines
27 KiB
Markdown
# R6 Localization research (2026-10-06)
|
||||
|
|
|
|||
|
|
Status: research, nothing built. Every choice is PROPOSED; the owner decides.
|
|||
|
|
Paths: `<game>` = LonaRPG root, `<mod>` = `<game>/ModScripts/_Mods/LonaCraft`, `<mods>` = `<game>/ModScripts/_Mods`.
|
|||
|
|
Line numbers are as read on 2026-10-06; other executors are editing the mod, so mod lines may shift by a few.
|
|||
|
|
|
|||
|
|
## Summary
|
|||
|
|
|
|||
|
|
| # | Finding |
|
|||
|
|
|---|---|
|
|||
|
|
| 1 | The mod is already almost fully behind text keys: 302 keys, 66 item files (132 key refs, none missing), 0 text in Recipes/*.json, 0 text in Maps. Hard-coded player-visible words: 9 (3 error box headers, 5 fallback tier names, 1 composed sentence), plus 15 punctuation/format joins, plus 6 debug-popup bits. |
|
|||
|
|
| 2 | All five other language folders (CHT, KOR, MTL, RUS, UKR) are byte-identical copies of ENG: 0 translated keys out of 302 each. |
|
|||
|
|
| 3 | The game never selects MTL (language list = folders of `<game>/Text/`, which has no MTL). Delete it. |
|
|||
|
|
| 4 | A missing KEY shows the raw key text; a missing FILE shows a blocking `msgbox` error then raw keys; neither falls back to ENG. The game has no fallback. |
|
|||
|
|
| 5 | A fallback hook fits in one new file (about 30 lines) because the mod already aliases `Text#[]` (`Scripts/50_Tiers.rb:537-554`). |
|
|||
|
|
| 6 | Recommendation: (a) key the 1 composed sentence only, leave error boxes, debug and glue; (b) add the ENG fallback hook; (c) machine-translate CHT/KOR/RUS/UKR with Claude, marked for review, after the key set settles; (d) scratchpad checker; (e) drop MTL. 4 build items (section 5). |
|
|||
|
|
|
|||
|
|
## 1. How the game picks a language and loads text
|
|||
|
|
|
|||
|
|
| Fact | Evidence |
|
|||
|
|
|---|---|
|
|||
|
|
| Language code is read from `UserData/GameLona.ini` `[LonaRPG] Language` (now `ENG`). | `<game>/UserData/GameLona.ini:2-9`; `<game>/Data/Scripts/Frames/5_DataManager.rb:105-108` |
|
|||
|
|
| Supported codes = the sub-folders of `<game>/Text/`: today CHT, ENG, KOR, RUS, UKR. The list is built by scanning the folder, not hard-coded. | `5_DataManager.rb:273-286` (`createLangArray`); `<game>/Text/` listing |
|
|||
|
|
| An unknown code at boot resets to `ENG` and starts the first-run language pick. | `5_DataManager.rb:94-102` |
|
|||
|
|
| The language picks (title options, first-run setup, in-game System menu) all list `createLangArray`. | `Data/Scripts/Editables/122_Scene_TitleOption.rb:75`; `123_Scene_FirstTimeSetup.rb:56`; `Frames/194_menu_08_0_System.rb:339, 804` |
|
|||
|
|
| Adding a language = a new folder under `<game>/Text/` plus a `Fonts/SYS-<CODE>-*.ttf`. | `<game>/Fonts/_HowToAddFontToYourLang.txt` |
|
|||
|
|
| Fonts per language: CHT, KOR, RUS, UKR, ENG each ship a `SYS-<code>` font. CHT/KOR/JPN get a larger message size. | `<game>/Fonts/` listing; `Editables/50_System_Settings.rb:12, 40` |
|
|||
|
|
| A mod declares `"texts": "Text"` in `_ModInfo.json`; the loader stores it and registers the folder `<mod path>/Text/<$lang>` as part `<mod id>`. | `<mod>/_ModInfo.json:6`; `Frames/RVscript/710_Mod_InGameUI_ClassMod.rb:31`; `730_Mod_InGameUI_mod_manager.rb:240-244` (`link_texts`) |
|
|||
|
|
| Key syntax: `Part:File:id`. A mod key is `LonaCraft:<File>:<id>`, which reads `<mod>/Text/<lang>/<File>.txt`, block `<id>`. Two-part keys (`File:id`) are the game's own `<game>/Text/<lang>/`. | `121_Dialog_Control_System.rb:87-96` (`split_key`), `98-111` (`[]`), `113-121` (`load_file`) |
|
|||
|
|
| File format: blocks separated by a blank line; first line = id, then body lines; `#` lines skipped; body lines joined with `\f`. A body line containing `:` is split as `speaker: text` (the trap noted in every mod Text file header). | `121_Dialog_Control_System.rb:123-148`, esp. `137` |
|
|||
|
|
| Text is read lazily: a file is loaded on the first lookup and cached in the `Text` object. The `Text` object is rebuilt (cache cleared) at boot, on every `update_Lang`, and whenever `create_game_objects` runs (new game, load). `update_Lang` re-links all mod parts. | `5000_Mod_loader.rb:4-7` (`<game>/ModScripts/`); `5_DataManager.rb:114-117, 530-534`; `121_...rb:103-105` |
|
|||
|
|
| Switching language in a menu rebuilds at once (`update_Lang`); title/first-run options also show a "restart recommended" notice. | `194_menu_08_0_System.rb:802-806`; `122_Scene_TitleOption.rb:380-388` |
|
|||
|
|
| Item names and descriptions: JSON `"textFlag": {"name": "<key>", "description": "<key>"}`; the key is read through `$game_text` by every item screen. | `Frames/Modules/ItemConfig.rb:159-161`; mod example `<mod>/Item/Plank.json` |
|
|||
|
|
| Mods menu: a `_ModInfo.json` description starting with `$` is resolved as a key (`LonaCraft` uses `$LonaCraft:Info:ModInfo/description`). | `710_Mod_InGameUI_ClassMod.rb:93-94`; `720_Mod_InGameUI_MOD SCENE.rb:474`; `<mod>/_ModInfo.json:5` |
|
|||
|
|
| Popups given a string go through `$game_text[...]`, so keys work in `$game_map.popup`; a plain sentence with no `:` passes through unchanged. | `Frames/200_Galv_Event_Popup.rb:109` |
|
|||
|
|
| Escape `\t[key]` inside a message resolves a key (this is what `call_msg("key")` does). | `Frames/53_Window_Base.rb:246-248`; `Editables/29_Functions_417_Interpreter.rb:202-207` |
|
|||
|
|
|
|||
|
|
### Fallback behaviour when something is missing
|
|||
|
|
|
|||
|
|
| Case | What happens | Evidence |
|
|||
|
|
|---|---|---|
|
|||
|
|
| Key missing in the chosen language, file exists | `$game_text[key]` returns the key string itself (e.g. `LonaCraft:Items:Plank/item_name`). With `noError = true` it returns `""`. No crash, no ENG fallback. | `121_Dialog_Control_System.rb:105-110` |
|
|||
|
|
| Mod folder `Text/<lang>/<File>.txt` missing | A blocking `msgbox "ERROR: missing translation file ..."` (once per file per rebuild of `$game_text`), then every key of that file shows as the raw key. | `121_...rb:113-121` (118 is the `msgbox`), cached empty hash at `100-104` |
|
|||
|
|
| Mod part not registered (mod disabled / `texts` empty) | Returns the key. | `121_...rb:100` |
|
|||
|
|
| Malformed key (not 2 or 3 parts) | Returns the key. | `121_...rb:87-96, 100` |
|
|||
|
|
|
|||
|
|
Real-world check: RolePlayS ships only `Text/CHT` (1 file, `GGININDER.txt`), `ENG` and `RUS` (`<mods>/RolePlayS/Text/`), so in KOR and UKR (and CHT for most files) RolePlayS shows error boxes and raw keys. Nothing in RolePlayS hooks a fallback (its attempt is commented out: `RolePlayS/Scripts/999_tmp_CORE.rb:821-837`).
|
|||
|
|
|
|||
|
|
### Can a mod hook a fallback?
|
|||
|
|
|
|||
|
|
Yes. `Text` is an ordinary Ruby class; LonaCraft already reopens it and aliases `[]` (`Scripts/50_Tiers.rb:537-554`, answers its `LCTier:` keys and decorates base names). A second alias on `[]` and one on `load_file(part = nil, file)` (`121_...rb:113`) can answer a missing `LonaCraft:` key or file from `Text/ENG`. See 5(b). `Text#parse` (`121_...rb:123`) can be reused to read the ENG file.
|
|||
|
|
|
|||
|
|
### What MTL is
|
|||
|
|
|
|||
|
|
| Fact | Evidence |
|
|||
|
|
|---|---|
|
|||
|
|
| The game never loads a folder called MTL: `createLangArray` lists `<game>/Text/` only (CHT, ENG, KOR, RUS, UKR), and a mod folder is read only as `Text/<$lang>`. | `5_DataManager.rb:273-286, 106`; `730_...mod_manager.rb:242`; `<game>/Text/` listing |
|
|||
|
|
| "MTL" appears nowhere in the game scripts or the mod's scripts; only in `docs/BOARD.md:16` and the lore notes ("MTL tier" = machine-translated quality). | grep of `<game>/Data/Scripts`, `<mod>/Scripts`, `<mod>/docs`; `<mods>/LonaRPG_Lore_B.0.10.8.26.md:510, 1843, 2255` |
|
|||
|
|
| The booba mod carries the same dead `Text/MTL/` (an identical copy of ENG), so MTL looks like a layout copied between mods, not a language. | `<mods>/Lona_Booba_Graphics/Text/` (CHT, ENG, KOR, MTL, RUS); its `MTL/booba.txt` = ENG |
|
|||
|
|
| Result: dead folder, 8 files, 302 keys of English. Candidate for deletion. | section 2 |
|
|||
|
|
|
|||
|
|
## 2. Current state of `<mod>/Text`
|
|||
|
|
|
|||
|
|
Counted with the game's own block rule (blank-line separated blocks). Snapshot 15:5x on 2026-10-06; the Menu file is new that hour.
|
|||
|
|
|
|||
|
|
| File | Keys | ENG lines | What it holds |
|
|||
|
|
|---|---|---|---|
|
|||
|
|
| Craft.txt | 31 | 98 | crafting screen heads, groups, labels, messages, station names |
|
|||
|
|
| Furniture.txt | 173 | 586 | 54 pieces x (item_name, description, menu) = 162, 4 `menu_town`, 7 shared (Place/*, Storage/*) |
|
|||
|
|
| Homes.txt | 29 | 101 | 3 homes (shack, stone house, inn room), seller menu labels, purchase text |
|
|||
|
|
| Info.txt | 2 | 10 | Mods-menu description, load-order warning |
|
|||
|
|
| Items.txt | 24 | 76 | 12 materials x (item_name, description) |
|
|||
|
|
| Menu.txt | 7 | 26 | main-menu "Craft" page (`Scripts/85_MenuCraft.rb`) |
|
|||
|
|
| Station.txt | 22 | 75 | pot prompt, 9 process labels, 7 salvage texts |
|
|||
|
|
| Tiers.txt | 14 | 49 | 5 tier names, bonus words, skill name, level-up popup |
|
|||
|
|
| Total | 302 | 1,021 | 367 text lines, about 1,983 words, about 11.5k characters, 20,651 bytes, 0 non-ASCII |
|
|||
|
|
|
|||
|
|
| Language | Files | Keys | Differs from ENG | Verdict |
|
|||
|
|
|---|---|---|---|---|
|
|||
|
|
| ENG | 8 | 302 | (source) | real |
|
|||
|
|
| CHT | 8 | 302 | 0 files (`diff -rq`) | English copy |
|
|||
|
|
| KOR | 8 | 302 | 0 files | English copy |
|
|||
|
|
| MTL | 8 | 302 | 0 files | English copy, never loaded |
|
|||
|
|
| RUS | 8 | 302 | 0 files | English copy |
|
|||
|
|
| UKR | 8 | 302 | 0 files | English copy |
|
|||
|
|
|
|||
|
|
Other mods for comparison (`<mods>/*/Text/`):
|
|||
|
|
|
|||
|
|
| Mod | Languages shipped | Translated for real |
|
|||
|
|
|---|---|---|
|
|||
|
|
| LonaCraft | ENG CHT KOR MTL RUS UKR | ENG only |
|
|||
|
|
| RolePlayS | ENG, RUS (20 files each), CHT (1 file) | RUS yes (human, Cyrillic); CHT 1 file |
|
|||
|
|
| Campsites | ENG (`strings.txt`) | ENG only |
|
|||
|
|
| Otto_PassiveRegen | ENG, RUS | RUS |
|
|||
|
|
| Lona_Booba_Graphics | CHT ENG KOR MTL RUS (1 file) | none (copies) |
|
|||
|
|
| CustomDifficulty, EasyTravel | `"texts": ""`, labels hard-coded in code/JSON | n/a |
|
|||
|
|
|
|||
|
|
Encoding: the game's own Text files are UTF-8 without BOM, LF (`<game>/Text/CHT/DataEquip.txt`, first bytes `# #`). The loader does `File.read(...).encode("utf-8")` (`121_...rb:115`); write mod files as UTF-8 without BOM, LF.
|
|||
|
|
|
|||
|
|
## 3. Audit of strings not read through a text key
|
|||
|
|
|
|||
|
|
Method: every string literal in `Scripts/*.rb`, `HCGframes/*.rb`, `loader.rb` outside comments and `p` lines, plus every `Item/*.json` (66) and `Recipes/*.json` (56), plus `Maps/*.rvdata2` and `Salvage/*.json`.
|
|||
|
|
|
|||
|
|
Clean (no hard-coded text): `Item/*.json` (all 66 carry `textFlag`; all 132 keys exist in ENG), `Recipes/*.json` (item ids and numbers only), `Maps/*.rvdata2` (only `-point-` event names), `Salvage/1000_LonaCraft_Salvage.json` (`export_name` is internal), `HCGframes/*.rb` (one call each), menu labels, crafting screen headers, popups, choice labels, station names, furniture names and menus, home texts, "(Common)" tier word (key `Tiers:Tier/name1`). The mod's `name` "LonaCraft" is a brand.
|
|||
|
|
|
|||
|
|
### 3a. Player sees it, not behind a key (normal play)
|
|||
|
|
|
|||
|
|
| # | Where | String | Verdict |
|
|||
|
|
|---|---|---|---|
|
|||
|
|
| H1 | `Scripts/0_Core.rb:134` | `msgbox("LonaCraft failed to load its data.\n" + message + backtrace)` | error box with Ruby backtrace; keep English |
|
|||
|
|
| H2 | `Scripts/50_Tiers.rb:207` | `msgbox("LonaCraft failed to build quality tiers. ...")` | same, keep English |
|
|||
|
|
| H3 | `Scripts/55_Recipes.rb:214` | `msgbox("LonaCraft failed to build its recipes. ...")` | same, keep English |
|
|||
|
|
| H4 | `Scripts/50_Tiers.rb:49-53` | `TIERS` fallback names Common, Uncommon, Rare, Epic, Legendary; used only when the tier key is missing (`50_Tiers.rb:154-157`, `tier_name`) | this is already an in-code ENG fallback; the hook (5b) makes it redundant but harmless; keep |
|
|||
|
|
| H5 | `Scripts/30_Process.rb:155` (with `108-113`) | `"\t[Process/fibre_used] " + "<plant> x2, <plant> x1" + "."` : the sentence is the key, but the list, the `x`, the `, ` and the final `.` are glued in code. Korean and Chinese put the verb after the list, so the sentence cannot be translated properly. | KEY IT: make the key a template with `%s` |
|
|||
|
|
|
|||
|
|
### 3b. Punctuation and format glue (language-neutral enough; leave)
|
|||
|
|
|
|||
|
|
| Where | Glue |
|
|||
|
|
|---|---|
|
|||
|
|
| `Scripts/50_Tiers.rb:449, 473` | `"<name> (<tier>)"` ASCII parentheses |
|
|||
|
|
| `Scripts/50_Tiers.rb:502` | `", "` between bonus stats |
|
|||
|
|
| `Scripts/50_Tiers.rb:507` | `"+"` sign |
|
|||
|
|
| `Scripts/30_Process.rb:111-112` | `" x2"` and `", "` between plants |
|
|||
|
|
| `Scripts/80_CraftScene.rb:517, 590` | `"x2"` output quantity |
|
|||
|
|
| `Scripts/80_CraftScene.rb:611` | `"have/need"` |
|
|||
|
|
| `Scripts/80_CraftScene.rb:623` | `"Need 3 You 2 (Level 1)"` spacing and parentheses |
|
|||
|
|
| `Scripts/80_CraftScene.rb:656` | `"50%"` |
|
|||
|
|
| `Scripts/80_CraftScene.rb:669` | two-space join of ATK/DEF parts |
|
|||
|
|
| `Scripts/85_MenuCraft.rb:111` | `"<Craft/level> <n>"` |
|
|||
|
|
| `Scripts/0_Core.rb:162` | `", "` between mod names in the load-order box |
|
|||
|
|
|
|||
|
|
Count: 15 sites. A Chinese translator might prefer full-width brackets; not worth a key (PROPOSED: leave).
|
|||
|
|
|
|||
|
|
### 3c. Debug (visible only while `DEBUG = true`, `Scripts/95_Debug.rb:18`; the hotkeys are numpad)
|
|||
|
|
|
|||
|
|
| Where | String |
|
|||
|
|
|---|---|
|
|||
|
|
| `Scripts/95_Debug.rb:52` | `"LonaCraft debug +10 x N <label>"` with labels `"materials"` (80), `"furniture"` (83), `"raw inputs"` (85) |
|
|||
|
|
| `Scripts/95_Debug.rb:62` | `"LonaCraft debug crafting level N"` |
|
|||
|
|
| `Scripts/95_Debug.rb:89` | `"LonaCraft debug all homes owned or rented 52 weeks (N)"` |
|
|||
|
|
|
|||
|
|
Developer tool; stays English. Note `DEBUG = true` ships on today: the owner may want it `false` for a release (outside this item).
|
|||
|
|
|
|||
|
|
### 3d. Console only (`p` lines; stay English)
|
|||
|
|
|
|||
|
|
About 90 `p "..."` lines (per file: 0_Core 5, 100_Homes 27, 10_Icons 1, 30_Process 1, 40_Mining 1, 50_Tiers 10, 55_Recipes 6, 60_Skill 4, 70_Save 13, 80_CraftScene 1, 85_MenuCraft 2, 90_Furniture 18, 95_Debug 1). `0_Core.rb:161` is the console twin of the keyed load-order box.
|
|||
|
|
|
|||
|
|
### 3e. Translation traps found in the existing keys (not hard-coded strings, but they affect (c))
|
|||
|
|
|
|||
|
|
| Trap | Evidence | Why it matters |
|
|||
|
|
|---|---|---|
|
|||
|
|
| `\optB[a,b,c]` lists live inside the translation; the count and order of entries must equal ENG, because code maps pick index to action. | `Text/ENG/Furniture.txt:7-8` header; `Scripts/90_Furniture.rb:1028` (`actions_for(kind, town)[pick]`, defined `:212`) | A translator that adds or drops an entry breaks furniture actions. 68 lines carry `\optB`; 42 of them are the same `Pick up,Cancel` list. |
|
|||
|
|
| No commas or `[` `]` in labels that get spliced into a seller's `\optB` (Homes `*_opt`, `common/collect_opt`, `common/gold`, Process labels). | `Text/ENG/Homes.txt:1-11` header; `Scripts/100_Homes.rb:996-1008`; `Text/ENG/Station.txt:4` | A comma splits one choice into two. |
|
|||
|
|
| Choice window is about 600 px wide; a longer line is squeezed. | `Text/ENG/Homes.txt:7-11` | Russian/Ukrainian run about 30% longer; CJK glyphs are double width. |
|
|||
|
|
| No ASCII `:` in body lines (parsed as `speaker: text`). | `121_...rb:137`; headers of every mod Text file | Translators write `:` by habit in RUS/UKR/CHT; use full-width `:` or rephrase. |
|
|||
|
|
| A blank line ends a block; `#` lines are dropped; `\n` ends each description line; `\}` opens it; `\narr`, `\cg[..]`, `#{$story_stats["HiddenOPT0"]}` and `%s` must be copied verbatim. | `121_...rb:123-148`; `Text/ENG/Items.txt`, `Homes.txt:76`, `Tiers.txt:4, 25` | Counted in the checker (5d). |
|
|||
|
|
| Process labels name vanilla items ("Wooden Club", "Crystal Ore", "Iron Ore") in full sentences. | `Text/ENG/Station.txt:14-41` | Translators must use the game's own item words (glossary below). |
|
|||
|
|
| Homes: `<price> <coin_week>` and `<buy_opt> <price> <gold>` fix the order (price after the label). | `Scripts/100_Homes.rb:999-1008` | Acceptable; translators put the unit word in the key (`LC/week`). |
|
|||
|
|
| Menu keys for a new `:hand` station and arrow group are coming (`Station/hand`, `Group/Ammo`, Pot text removed). `Craft:Station/hand` is not in `Craft.txt` yet; today `:hand` is not in `Stations::LIST` (`55_Recipes.rb:49`) so the screen falls back to the pot (`80_CraftScene.rb:35`). | `docs/SPEC_MENU_CRAFT.md:74, 165-166, 276-278`; `Scripts/85_MenuCraft.rb:49` | The key set is still moving; translate after it settles or run the checker per batch. |
|
|||
|
|
|
|||
|
|
Vanilla glossary that the translations should reuse (read from `<game>/Text/<lang>/`):
|
|||
|
|
|
|||
|
|
| Term used in LonaCraft ENG | Vanilla key | ENG | CHT | KOR | RUS | UKR |
|
|||
|
|
|---|---|---|---|---|---|---|
|
|||
|
|
| Wooden Club | `DataEquip:MhWoodenClub/item_name` | Wooden Club | 木棒 | 나무 몽둥이 | Дубинка | Дерев’яна палиця |
|
|||
|
|
| Crystal Ore | `DataItem:Mineral/item_name` | Crystal Ore | 晶礦 | 광석 | Кристаллическая руда | Кристалічна Руда |
|
|||
|
|
| Large Copper Coin | `DataItem:Coin2/item_name` | Large Copper Coin | 大銅幣 | 큰 동전 | Большой медяк | Велика мідна монета |
|
|||
|
|
| Gold Coin | `DataItem:Coin3/item_name` | Gold Coin | 金幣 | 금화 | Золотая монета | Золота монета |
|
|||
|
|
| ATK | `menu:equip/atk` (`Text/ENG/menu.txt:646`) | ATK | 攻擊 | 공격 | АТК | АТК |
|
|||
|
|
| DEF | `menu:equip/def` (`:649`) | DEF | 防禦 | 방어 | ЗАЩ | ЗАХ |
|
|||
|
|
| HP | `menu:core_stats/hp` (`:121`) | HP | 生命 | 생명 | ОЗ | Здоров’я |
|
|||
|
|
| STA | `menu:core_stats/sta` (`:127`) | STA | 體力 | 스태미너 | СИЛА | Сили |
|
|||
|
|
| SPD | `menu:equip/spd` (`:679`) | SPD | 敏捷 | 속도 | СКОР | ШВД |
|
|||
|
|
| Level | `menu:main_stats/level` (`:184`) | Level | 等級 | 레벨 | Уровень | Рівень |
|
|||
|
|
|
|||
|
|
`Tiers.txt:5` already says "Bonus/*: stat words as in the game's DataEquip.txt"; the vanilla keys above are the real source and are localised in all four languages.
|
|||
|
|
|
|||
|
|
## 4. How RolePlayS localises, and what to copy
|
|||
|
|
|
|||
|
|
| Aspect | RolePlayS | Evidence | LonaCraft today |
|
|||
|
|
|---|---|---|---|
|
|||
|
|
| Mechanism | `"texts": "Text"`; items use `"textFlag": {"name": "RolePlayS:DataItem:<Id>/item_name", ...}`; no per-language JSON fields | `<mods>/RolePlayS/_ModInfo.json:12`; `RolePlayS/Item/BehelitAbom.json` | same mechanism (`textFlag` + `Text/<lang>/`) |
|
|||
|
|
| File layout | Mirrors the game's files: `DataItem.txt`, `DataEquip.txt`, `DataSkill.txt`, `DataState.txt`, `menu.txt`, `QuickMsg.txt`, `Locations.txt`, plus `mail/` | `<mods>/RolePlayS/Text/ENG/` (20 files) | by topic: Items, Furniture, Homes, Craft, Station, Tiers, Menu, Info: fine, keep |
|
|||
|
|
| Key style | `<Id>/item_name`, `<Id>/description`; menu keys `menu:attr_up/up` | `RolePlayS/Text/ENG/DataItem.txt:280-286`; `RolePlayS/Scripts/05_Attr_Exp.rb:190-193` | same `<Id>/item_name`, `<Id>/description` |
|
|||
|
|
| Description style | `\}` first line, each line ends `\n`, first-person Lona voice | `RolePlayS/Text/ENG/DataItem.txt:284-285`; vanilla `<game>/Text/ENG/DataEquip.txt:555-558` | `\}Crafting material. ...\n` : matches |
|
|||
|
|
| Translations | Real RUS (same keys, same line structure, 296 vs 295 lines in DataItem); CHT 1 file; no KOR, no UKR | `RolePlayS/Text/RUS/DataItem.txt:281-286`; `Text/CHT/GGININDER.txt` | none |
|
|||
|
|
| Reuse of vanilla keys | Campsites reuses `OvermapEvents:World/Region_option_Cancel` etc. instead of new words | `<mods>/Campsites/Scripts/10_Campsites.rb:365-368` | own words for ATK/DEF/Level/Cancel |
|
|||
|
|
| Missing language | no fallback; error boxes in KOR/UKR | section 1 | no fallback (all copies) |
|
|||
|
|
|
|||
|
|
Conventions LonaCraft should copy: keep `<Id>/item_name` + `<Id>/description` keys and the `\}`..`\n` description shape (already so); describe vanilla terms with the vanilla words (glossary); reuse vanilla keys for universal words (Campsites precedent); real translations go in the same file and key layout as ENG so a diff works (RolePlayS RUS is line-for-line with ENG). With RolePlayS only in ENG/RUS (and one CHT file), LonaCraft cannot look "consistent" with it in KOR/UKR: that gap is RolePlayS's, not fixable here (PROPOSED: do not touch it).
|
|||
|
|
|
|||
|
|
## 5. PROPOSED plan
|
|||
|
|
|
|||
|
|
### (a) Text-key sweep
|
|||
|
|
|
|||
|
|
| Option | Effect | Cost |
|
|||
|
|
|---|---|---|
|
|||
|
|
| A1 Key all 9 hard-coded words incl. error boxes, tier fallback, debug | 100% literal | error boxes carry backtraces (cannot be keyed usefully); debug never leaves the owner |
|
|||
|
|
| A2 (RECOMMENDED) Key only what needs a different sentence shape: H5 (`Process/fibre_used` becomes `"... out of %s."` and the code does the `gsub`; `Desc/header` already uses `%s`, `Tiers.txt:4, 25`). Leave H1-H4, glue (3b), debug (3c), console (3d) | every normal-play sentence is translatable; 0 new keys, 1 changed key | `Scripts/30_Process.rb:108-113, 155` (about 6 lines) + `Text/<lang>/Station.txt` `Process/fibre_used` |
|
|||
|
|
| A3 A2 plus format keys for the glue in 3b | full-width brackets etc. | 3-5 new keys x 5 languages; low value |
|
|||
|
|
|
|||
|
|
Also PROPOSED within A2 (optional, in the same item): read ATK, DEF, HP, STA, SPD, Level from the vanilla keys in the glossary table instead of owning 8 keys of our own (`Craft:Label/Level, Atk, Def`; `Tiers:Bonus/atk, def, sta, health, move_speed`). Saves 8 keys x 4 languages (32 translations) and matches the equipment screen in every language. Risk: low; the 8 keys stay in ENG as the fallback if the vanilla key is ever missing. Use: `$game_text["menu:equip/atk"]`.
|
|||
|
|
|
|||
|
|
### (b) ENG fallback for a missing key
|
|||
|
|
|
|||
|
|
| Option | How | Cost |
|
|||
|
|
|---|---|---|
|
|||
|
|
| B1 (RECOMMENDED) Runtime hook for the `LonaCraft` part: new `Scripts/5_TextFallback.rb`, loaded right after `0_Core.rb` in `loader.rb`. (1) Alias `Text#[]`: split the key, if part is `LonaCraft` and the result equals the key or is empty and `$lang != "ENG"`, return the same id from `Text/ENG/<File>.txt`. (2) Alias `Text#load_file(*args)`: for part `LonaCraft`, if `Text/<lang>/<File>.txt` is missing, return the parsed ENG file and skip the blocking `msgbox`. The ENG file is read once per file per session with `Text#parse` and kept in a module-level Hash (survives `Text.new` on language switch, since ENG never changes). | one new file about 30 lines, one line in `loader.rb`; cost at run time: a Hash lookup only on a miss. It coexists with the Tiers alias (`50_Tiers.rb:537-554`), whichever loads first. |
|
|||
|
|
| B2 Tool-synced files: the checker copies missing ENG keys into each language file | no runtime code | re-creates today's problem (English copies cannot be told from translations); needs a re-run on every key added |
|
|||
|
|
| B3 Nothing: raw keys and error boxes in the untranslated languages | zero | unacceptable: a player on KOR sees `LonaCraft:Furniture:Bed/menu` |
|
|||
|
|
| B4 Generic hook for every mod part (fixes RolePlayS in KOR/UKR too) | same code, no `LonaCraft` check | changes other mods' behaviour without their authors; not recommended |
|
|||
|
|
|
|||
|
|
With B1, a language folder may hold only the keys that are really translated (a missing key or file shows ENG), which also fixes the "copies look like translations" problem. The owner can still hot-test: switch language and back in the System menu to rebuild `$game_text` and reload the files without a restart (`194_menu_08_0_System.rb:802-806`).
|
|||
|
|
|
|||
|
|
### (c) How the translations get made
|
|||
|
|
|
|||
|
|
| Option | Quality | Cost | Risk |
|
|||
|
|
|---|---|---|---|
|
|||
|
|
| C1 Owner-provided | best | owner time, about 2,000 words x 4 | slow; blocks release |
|
|||
|
|
| C2 (RECOMMENDED) Claude translates CHT, KOR, RUS, UKR, one executor per language, with the vanilla glossary (section 3e) and the rules in 3e as input; each file starts with a `#` comment line `# Machine-translated by Claude on <date>, not reviewed by a native speaker` (comment lines are dropped by the parser, `121_...rb:129`); the checker (d) gates it (keys, `\optB` counts, control codes, `:`); the owner or a community reviewer corrects later and removes the comment | good for UI/short text; flavour text and Lona's voice in CHT/KOR need review | about 2,000 words per language; order of 20-25k output tokens per language plus glossary input; Sonnet for RUS/UKR, Opus for CHT/KOR | tone and register errors; labelled so players know |
|
|||
|
|
| C3 Leave English | n/a | zero | mixed UI; fine only with (b) |
|
|||
|
|
|
|||
|
|
Timing: do C2 after the in-flight key changes land (`docs/SPEC_MENU_CRAFT.md:74, 165-166, 276-278`: `Station/hand`, `Group/Ammo`, pot text removal, arrows; also R3 base building and R5 nodes add keys). Until then (b) covers every new key. After C2, only the delta (checker's "missing" list) is translated per milestone.
|
|||
|
|
|
|||
|
|
### (d) The checker (describe, not written)
|
|||
|
|
|
|||
|
|
A single Python 3.10 script run from the scratchpad (not shipped in the mod folder), `python lc_text_check.py [--lang CHT] [--code]`, output as tables, exit code 1 when anything is missing. It uses the game's parse rule (blank-line blocks, `#` skipped) and prints per language and per file:
|
|||
|
|
|
|||
|
|
| Check | Reports |
|
|||
|
|
|---|---|
|
|||
|
|
| Missing keys | in ENG, absent in `<lang>` |
|
|||
|
|
| Extra keys | in `<lang>`, absent in ENG |
|
|||
|
|
| Untranslated | body identical to ENG (excluding keys that are numbers or names) |
|
|||
|
|
| `\optB` entry count / order | count differs from ENG |
|
|||
|
|
| Forbidden characters | ASCII `,` `[` `]` in labels spliced into `\optB` (Homes `*_opt`, `common/*`, Process labels); ASCII `:` in any body line |
|
|||
|
|
| Control codes | the multiset of `\narr`, `\}`, `\n`, `\cg[..]`, `\C[..]`, `#{..}`, `%s` differs from ENG |
|
|||
|
|
| Width | display width of `\optB` lines over ENG width x 1.3 (CJK counted double) |
|
|||
|
|
| Format | empty body, duplicate key, BOM, CRLF, non-UTF-8, id with a space or colon |
|
|||
|
|
| `--code` (optional) | keys referenced by the Ruby/JSON (static `"LonaCraft:File:id"` strings and `#{}` prefixes such as `Process/#{key}`) that ENG does not define (typos), and ENG keys nothing references |
|
|||
|
|
|
|||
|
|
It also prints a coverage table (`lang | translated | missing | untranslated | %`). A first draft of the code-reference part already ran (`audit.py` in the scratchpad): 302 keys defined, all 132 `textFlag` references resolve.
|
|||
|
|
|
|||
|
|
### (e) Drop MTL
|
|||
|
|
|
|||
|
|
PROPOSED: yes, delete `<mod>/Text/MTL/` (8 files). The game cannot select it (section 1); keeping it adds one more copy to keep in step with every new key. If the owner ever wants a machine-translated tier, it would have to be a real game language folder under `<game>/Text/` plus a font (`_HowToAddFontToYourLang.txt`), which is out of scope for a mod.
|
|||
|
|
|
|||
|
|
### Recommendation in one line
|
|||
|
|
|
|||
|
|
A2 + B1 + C2 + the checker + delete MTL, as four build items; start with L1 and L2 (small, no translation), run L3 once the owner has settled the key set.
|
|||
|
|
|
|||
|
|
### Work breakdown
|
|||
|
|
|
|||
|
|
| Item | Builds | Files touched | Strings | Executor |
|
|||
|
|
|---|---|---|---|---|
|
|||
|
|
| L1 Fallback hook and sentence key | B1; A2 (H5) and optional vanilla-key reuse | new `Scripts/5_TextFallback.rb`; `loader.rb` (+1 line); `Scripts/30_Process.rb:108-113, 155`; `Text/ENG/Station.txt` (`Process/fibre_used`); optional `Scripts/80_CraftScene.rb`, `Scripts/50_Tiers.rb` text lookups for the 8 stat/level words | 1 key reworded (x1 ENG; the other languages get it in L3); optional 8 keys retired | Sonnet builder (small); owner decides the optional part |
|
|||
|
|
| L2 Checker, MTL removal, baseline | (d), (e) | scratchpad `lc_text_check.py`; delete `Text/MTL/` (8 files); `docs/BOARD.md` note; README one line on languages | 0 strings; baseline table (302 keys, 0 translated x 4) | Sonnet |
|
|||
|
|
| L3 Translations (4 in parallel, one per language) | C2 | `Text/CHT/*.txt`, `Text/KOR/*.txt`, `Text/RUS/*.txt`, `Text/UKR/*.txt` (8 files each, 32 total) | 302 keys per language (294 if the vanilla reuse in L1 lands), about 1,983 words, about 11.5k characters of ENG source each; 4 languages = about 1,200 keys | Sonnet RUS/UKR, Opus CHT/KOR; checker gate; no shared files so no merge conflict |
|
|||
|
|
| L4 Delta passes (recurring) | keep languages current | the files above, only the checker's missing list | the keys added by each milestone (R2 B1/B3, R3, R5) | Sonnet, after each milestone |
|
|||
|
|
|
|||
|
|
Gate for each build item stays as the board says (static checks by Claude, then the owner's in-game run, no agent launches the game). L3's extra gate: the checker prints 0 missing, 0 control-code mismatches, 0 `\optB` mismatches, 0 forbidden characters.
|
|||
|
|
|
|||
|
|
## Questions for the owner (one choice each, recommendation first)
|
|||
|
|
|
|||
|
|
| # | Question | Recommendation |
|
|||
|
|
|---|---|---|
|
|||
|
|
| Q1 | Add the ENG fallback hook (B1)? | Yes |
|
|||
|
|
| Q2 | Key only the fibre sentence (A2), keep error boxes, debug, glue in English? | Yes |
|
|||
|
|
| Q3 | Reuse the vanilla words for ATK/DEF/HP/STA/SPD/Level? | Yes |
|
|||
|
|
| Q4 | Translations by Claude with a review note (C2)? | Yes, after the key set settles |
|
|||
|
|
| Q5 | Delete `Text/MTL`? | Yes |
|
|||
|
|
| Q6 | Set `DEBUG = false` (`Scripts/95_Debug.rb:18`) for a release? | Outside R6; flag only |
|