# R6 Localization research (2026-10-06) Status: research, nothing built. Every choice is PROPOSED; the owner decides. Paths: `` = LonaRPG root, `` = `/ModScripts/_Mods/LonaCraft`, `` = `/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 `/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`). | `/UserData/GameLona.ini:2-9`; `/Data/Scripts/Frames/5_DataManager.rb:105-108` | | Supported codes = the sub-folders of `/Text/`: today CHT, ENG, KOR, RUS, UKR. The list is built by scanning the folder, not hard-coded. | `5_DataManager.rb:273-286` (`createLangArray`); `/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 `/Text/` plus a `Fonts/SYS--*.ttf`. | `/Fonts/_HowToAddFontToYourLang.txt` | | Fonts per language: CHT, KOR, RUS, UKR, ENG each ship a `SYS-` font. CHT/KOR/JPN get a larger message size. | `/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 `/Text/<$lang>` as part ``. | `/_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::`, which reads `/Text//.txt`, block ``. Two-part keys (`File:id`) are the game's own `/Text//`. | `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` (`/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": "", "description": ""}`; the key is read through `$game_text` by every item screen. | `Frames/Modules/ItemConfig.rb:159-161`; mod example `/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`; `/_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//.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` (`/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 `/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`; `/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 `/Data/Scripts`, `/Scripts`, `/docs`; `/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. | `/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 `/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 (`/*/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 (`/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] " + " x2, 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` | `" ()"` 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` | `" "` | | `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