i18n: a key used only in a listener counts as used - the key check walked prog but not the bodies kept beside it (@On listeners, the lifecycle hooks, tests, computed fields, scenes), so their keys were never checked against en.po and ludic schema listed them unused (the game's 15 itemuse.* keys, emitted through ItemPlace); they are walked now as privates.ludic walks them. examples/lang/i18n_listen and its schema case (added, not run); reseeded, bootstrap-cfree fixpoint holds

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-30 03:12:25 +03:00
parent e2aa928e95
commit 56762050fb
8 changed files with 64333 additions and 63946 deletions

View file

@ -341,10 +341,29 @@ function i18n_check() -> void {
if not is_runtime_file(prog[i].file) { i18n_walk(prog[i]) }
i += 1
}
# the bodies kept beside prog, as privates.ludic walks them: an @On listener's keys are used too
i18n_walk_all(g_tests)
i18n_walk_all(g_onlisten)
i18n_walk_all(g_onspawn)
i18n_walk_all(g_ondespawn)
i18n_walk_all(g_onattach)
i18n_walk_all(g_ondetach)
i18n_walk_all(g_onenable)
i18n_walk_all(g_ondisable)
i18n_walk_all(g_computed)
i18n_walk_all(g_scenes)
if not g_i18n_on { return }
i18n_walk_templates() # i18n_xml.ludic
i18n_split_check()
}
function i18n_walk_all(ns: []Node) -> void {
if ns == null { return }
var i = 0
while i < len(ns) {
if ns[i] != null and (ns[i].file == null or not is_runtime_file(ns[i].file)) { i18n_walk(ns[i]) }
i += 1
}
}
function i18n_is_data_file(f: pointer) -> bool {
if f == null { return false }
let n = len(f)