From 5d8dc56f330c03c87fde7fbbd412dc40a96d14be Mon Sep 17 00:00:00 2001 From: jpirnay Date: Thu, 19 Mar 2026 17:58:45 +0100 Subject: [PATCH] Minor changes --- scripts/gen_i18n.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/scripts/gen_i18n.py b/scripts/gen_i18n.py index 55aef15b..465737a0 100755 --- a/scripts/gen_i18n.py +++ b/scripts/gen_i18n.py @@ -266,7 +266,7 @@ def report_unused_keys( used_keys: Set[str], ) -> List[str]: """Return a sorted list of keys from *string_keys* absent in *used_keys*.""" - return [k for k in string_keys if k not in used_keys] + return [k for k in sorted(string_keys) if k not in used_keys] # --------------------------------------------------------------------------- @@ -846,6 +846,17 @@ def main( used_keys = set(string_keys) unused_set = set() + # --- Missing-string detection (used in code but absent from English) --- + missing_keys = sorted(used_keys - set(string_keys)) + if missing_keys: + print( + f"\n CRITICAL: {len(missing_keys)} string(s) used in source but missing from english.yaml:" + ) + for key in missing_keys: + print(f" - {key}") + print() + sys.exit(1) + # Compute per-language data blob sizes: # sum of UTF-8 byte length + 1 (null terminator) per string data_sizes = [