From cbdb7e0c8463da4a06c3fa99a548960672410c36 Mon Sep 17 00:00:00 2001 From: Hirek193 Date: Mon, 30 Nov 2026 17:34:29 +0100 Subject: [PATCH] fix(lang): sync_lang.py leaves the developer tab's rows to English, as the test does The developer tab's rows (Ini.*) and the words of its lists (Choice.*) come in English where a language lacks them (SimulatorKeyRows), and LocalizationTests counts them optional. sync_lang.py added them to every language as untranslated copies; now it adds them, as the other optional keys, only with --all, and --check finds every language in line. --- tools/sync_lang.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/sync_lang.py b/tools/sync_lang.py index 596719e..19f4049 100644 --- a/tools/sync_lang.py +++ b/tools/sync_lang.py @@ -5,8 +5,8 @@ For every language file in StarterNG/startercfg/lang (or the codes given): - a key en.xml has and the language lacks is added with the English text, right after the key it follows in en.xml, and marked ; - a key en.xml no longer has is removed. -Keys the starter falls back to English for by itself (ending in "Desc", starting with "Cmd.") -are only added with --all. Everything else in the file - comments, order, line endings - stays +Keys the starter falls back to English for by itself (ending in "Desc", starting with "Cmd.", and the +developer tab's "Ini." rows and "Choice." words, see SimulatorKeyRows) are only added with --all. Everything else in the file - comments, order, line endings - stays as it is. python tools/sync_lang.py # every language @@ -26,7 +26,8 @@ UNTRANSLATED = "" def is_optional(key): - return key.endswith("Desc") or key.startswith("Cmd.") + # As LocalizationTests.Every_language_has_every_key_but_the_optional_ones has them. + return key.endswith("Desc") or key.startswith(("Cmd.", "Ini.", "Choice.")) def read(path): @@ -148,7 +149,7 @@ def sync(path, en_text, en_strings, add_optional, check): def main(): parser = argparse.ArgumentParser(description=__doc__.splitlines()[0]) parser.add_argument("codes", nargs="*", help="language codes, e.g. zh cz; every language when none") - parser.add_argument("--all", action="store_true", help="add the optional keys (*Desc, Cmd.*) too") + parser.add_argument("--all", action="store_true", help="add the optional keys (*Desc, Cmd.*, Ini.*, Choice.*) too") parser.add_argument("--check", action="store_true", help="only report, change nothing") args = parser.parse_args()