diff --git a/i18n.py b/i18n.py index e9be731..51288e0 100644 --- a/i18n.py +++ b/i18n.py @@ -101,14 +101,18 @@ for lang in locales: print("Fixed", pofile[lang], "and converted ->", mofile) -for file in glob.glob("**/*.py") + glob.glob("**/*.kv"): - with open(file, "r") as f: - for i, line in enumerate(f.readlines()): - matches = [m.strip() for m in re.findall(r"i18n._\((.*?)\)", line)] - for msgid in matches: - stripped_msgid = msgid.strip("\"'") - if stripped_msgid and msgid[0] in ['"', "'"] and stripped_msgid not in strings_to_langs: # not code - print(f"Missing {msgid} used in code at \t{file}:{i} \t'{line.strip()}'") - errors += 1 - +for ext in ["py", "kv"]: + lc = 0 + for file in glob.glob(f"katrain/*.{ext}") + glob.glob(f"katrain/**/*.{ext}"): + with open(file, "r") as f: + for i, line in enumerate(f.readlines()): + if line.strip(): + lc += 1 + matches = [m.strip() for m in re.findall(r"i18n._\((.*?)\)", line)] + for msgid in matches: + stripped_msgid = msgid.strip("\"'") + if stripped_msgid and msgid[0] in ['"', "'"] and stripped_msgid not in strings_to_langs: # not code + print(f"Missing {msgid} used in code at \t{file}:{i} \t'{line.strip()}'") + errors += 1 + print(f"Checked {lc} lines of {ext} code for missing i18n entries.") sys.exit(int(errors)) diff --git a/katrain/gui/popups.py b/katrain/gui/popups.py index 4fcee19..ccbf738 100644 --- a/katrain/gui/popups.py +++ b/katrain/gui/popups.py @@ -263,7 +263,7 @@ class NewGamePopup(QuickConfigGui): self.katrain.game.root.set_property("P" + bw, name) self.katrain.update_player(bw, **player_setup.player_type_dump) - def update_from_current_game(self): + def update_from_current_game(self, *args): for bw in "BW": name = self.katrain.game.root.get_property("P" + bw, None) if name: diff --git a/katrain/i18n/locales/de/LC_MESSAGES/katrain.mo b/katrain/i18n/locales/de/LC_MESSAGES/katrain.mo index 62e3473..b86b0eb 100644 Binary files a/katrain/i18n/locales/de/LC_MESSAGES/katrain.mo and b/katrain/i18n/locales/de/LC_MESSAGES/katrain.mo differ diff --git a/katrain/i18n/locales/de/LC_MESSAGES/katrain.po b/katrain/i18n/locales/de/LC_MESSAGES/katrain.po index 01a7197..1f56f40 100644 --- a/katrain/i18n/locales/de/LC_MESSAGES/katrain.po +++ b/katrain/i18n/locales/de/LC_MESSAGES/katrain.po @@ -817,5 +817,5 @@ msgstr "Fast playout to game end" #. TODO - Status message msgid "playtoend:status" msgstr "" -"Playing the game quickly to the end, please wait ... {num_moves} moved " -"played.moves played." +"Playing the game quickly to the end, please wait ... {num_moves} moves " +"played." diff --git a/katrain/i18n/locales/en/LC_MESSAGES/katrain.mo b/katrain/i18n/locales/en/LC_MESSAGES/katrain.mo index 7894478..b13f739 100644 Binary files a/katrain/i18n/locales/en/LC_MESSAGES/katrain.mo and b/katrain/i18n/locales/en/LC_MESSAGES/katrain.mo differ diff --git a/katrain/i18n/locales/en/LC_MESSAGES/katrain.po b/katrain/i18n/locales/en/LC_MESSAGES/katrain.po index 918a962..935d239 100644 --- a/katrain/i18n/locales/en/LC_MESSAGES/katrain.po +++ b/katrain/i18n/locales/en/LC_MESSAGES/katrain.po @@ -125,8 +125,8 @@ msgstr "Fast playout to game end" #. Status message msgid "playtoend:status" msgstr "" -"Playing the game quickly to the end, please wait ... {num_moves} moved " -"played.moves played." +"Playing the game quickly to the end, please wait ... {num_moves} moves " +"played." #. Keep improving current position analysis when there is nothing else to do msgid "analysis:continuous" diff --git a/katrain/i18n/locales/es/LC_MESSAGES/katrain.mo b/katrain/i18n/locales/es/LC_MESSAGES/katrain.mo index 5f67881..348fa56 100644 Binary files a/katrain/i18n/locales/es/LC_MESSAGES/katrain.mo and b/katrain/i18n/locales/es/LC_MESSAGES/katrain.mo differ diff --git a/katrain/i18n/locales/es/LC_MESSAGES/katrain.po b/katrain/i18n/locales/es/LC_MESSAGES/katrain.po index 93c0209..c3bc833 100644 --- a/katrain/i18n/locales/es/LC_MESSAGES/katrain.po +++ b/katrain/i18n/locales/es/LC_MESSAGES/katrain.po @@ -824,5 +824,5 @@ msgstr "Fast playout to game end" #. TODO - Status message msgid "playtoend:status" msgstr "" -"Playing the game quickly to the end, please wait ... {num_moves} moved " -"played.moves played." +"Playing the game quickly to the end, please wait ... {num_moves} moves " +"played." diff --git a/katrain/i18n/locales/fr/LC_MESSAGES/katrain.mo b/katrain/i18n/locales/fr/LC_MESSAGES/katrain.mo index 3fddf6c..bb8458d 100644 Binary files a/katrain/i18n/locales/fr/LC_MESSAGES/katrain.mo and b/katrain/i18n/locales/fr/LC_MESSAGES/katrain.mo differ diff --git a/katrain/i18n/locales/fr/LC_MESSAGES/katrain.po b/katrain/i18n/locales/fr/LC_MESSAGES/katrain.po index 9eaa760..e65855d 100644 --- a/katrain/i18n/locales/fr/LC_MESSAGES/katrain.po +++ b/katrain/i18n/locales/fr/LC_MESSAGES/katrain.po @@ -851,5 +851,5 @@ msgstr "Fast playout to game end" #. TODO - Status message msgid "playtoend:status" msgstr "" -"Playing the game quickly to the end, please wait ... {num_moves} moved " -"played.moves played." +"Playing the game quickly to the end, please wait ... {num_moves} moves " +"played." diff --git a/katrain/i18n/locales/ko/LC_MESSAGES/katrain.mo b/katrain/i18n/locales/ko/LC_MESSAGES/katrain.mo index 366a5ef..492e242 100644 Binary files a/katrain/i18n/locales/ko/LC_MESSAGES/katrain.mo and b/katrain/i18n/locales/ko/LC_MESSAGES/katrain.mo differ diff --git a/katrain/i18n/locales/ko/LC_MESSAGES/katrain.po b/katrain/i18n/locales/ko/LC_MESSAGES/katrain.po index c8d1081..e309685 100644 --- a/katrain/i18n/locales/ko/LC_MESSAGES/katrain.po +++ b/katrain/i18n/locales/ko/LC_MESSAGES/katrain.po @@ -778,5 +778,5 @@ msgstr "Fast playout to game end" #. TODO - Status message msgid "playtoend:status" msgstr "" -"Playing the game quickly to the end, please wait ... {num_moves} moved " -"played.moves played." +"Playing the game quickly to the end, please wait ... {num_moves} moves " +"played." diff --git a/katrain/i18n/locales/ru/LC_MESSAGES/katrain.mo b/katrain/i18n/locales/ru/LC_MESSAGES/katrain.mo index 0bc8dd4..3fd538d 100644 Binary files a/katrain/i18n/locales/ru/LC_MESSAGES/katrain.mo and b/katrain/i18n/locales/ru/LC_MESSAGES/katrain.mo differ diff --git a/katrain/i18n/locales/ru/LC_MESSAGES/katrain.po b/katrain/i18n/locales/ru/LC_MESSAGES/katrain.po index 92f3c42..4d6d839 100644 --- a/katrain/i18n/locales/ru/LC_MESSAGES/katrain.po +++ b/katrain/i18n/locales/ru/LC_MESSAGES/katrain.po @@ -814,5 +814,5 @@ msgstr "Fast playout to game end" #. TODO - Status message msgid "playtoend:status" msgstr "" -"Playing the game quickly to the end, please wait ... {num_moves} moved " -"played.moves played." +"Playing the game quickly to the end, please wait ... {num_moves} moves " +"played."