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()