diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 5c6be85..4410b82 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -8,6 +8,7 @@ Matthew Allred ("Kameone") for design of the v1.1 UI and providing MacOS install "bale-go" for implementing and calibrating the 'calibrated rank' AI. "nimets123" for the German translation and sound effects. "nowoowoo" for a fix to the parser for SGF files with extra line breaks. +Sergio Villegas ("serpiente") for the Spanish translation. Additional thanks to: "Seventeen" for explanatory youtube videos. diff --git a/katrain/core/base_katrain.py b/katrain/core/base_katrain.py index 17d09d5..182e021 100644 --- a/katrain/core/base_katrain.py +++ b/katrain/core/base_katrain.py @@ -121,7 +121,7 @@ class KaTrainBase: try: if "/" in setting: cat, key = setting.split("/") - return self._config[cat].get(key, default) + return self._config.get(cat,{}).get(key, default) else: return self._config[setting] except KeyError: diff --git a/katrain/core/engine.py b/katrain/core/engine.py index 6662731..6de691e 100644 --- a/katrain/core/engine.py +++ b/katrain/core/engine.py @@ -61,21 +61,18 @@ class KataGoEngine: exepath, exename = os.path.split(exe) if exepath and not os.path.isfile(exe): - self.katrain.log(f"KataGo binary {exe} does not exist, check general settings.", OUTPUT_ERROR) + self.katrain.log(i18n._('Kata exe not found').format(exe=exe), OUTPUT_ERROR) return # don't start elif not exepath and not any( os.path.isfile(os.path.join(path, exe)) for path in os.environ.get("PATH", "").split(os.pathsep) ): - self.katrain.log( - f"KataGo binary `{exe}` not found in PATH, check your environment variables or add the full path in general settings.", - OUTPUT_ERROR, - ) + self.katrain.log(i18n._('Kata exe not found in path').format(exe), OUTPUT_ERROR ) return # don't start elif not os.path.isfile(model): - self.katrain.log(f"Model {model} does not exist, check general settings.", OUTPUT_ERROR) + self.katrain.log(i18n._('Kata model not found').format(model), OUTPUT_ERROR) return # don't start elif not os.path.isfile(cfg): - self.katrain.log(f"KataGo config file {cfg} does not exist, check general settings.", OUTPUT_ERROR) + self.katrain.log(i18n._('Kata config not found').format(config=cfg), OUTPUT_ERROR) return # don't start self.command = f'"{exe}" analysis -model "{model}" -config "{cfg}" -analysis-threads {config["threads"]}' self.start() @@ -88,14 +85,10 @@ class KataGoEngine: self.command, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True ) except (FileNotFoundError, PermissionError, OSError) as e: - if not self.config["katago"].strip(): - self.katrain.log( - i18n._("Starting default Kata failed").format(command=self.command, error=e), OUTPUT_ERROR, - ) - else: - self.katrain.log( - i18n._("Starting Kata failed").format(command=self.command, error=e), OUTPUT_ERROR, - ) + self.katrain.log( + i18n._("Starting Kata failed").format(command=self.command, error=e), OUTPUT_ERROR, + ) + return # don't start self.analysis_thread = threading.Thread(target=self._analysis_read_thread, daemon=True).start() self.stderr_thread = threading.Thread(target=self._read_stderr_thread, daemon=True).start() diff --git a/katrain/core/game.py b/katrain/core/game.py index 536d918..55b877d 100644 --- a/katrain/core/game.py +++ b/katrain/core/game.py @@ -320,7 +320,7 @@ class Game: engine = self.engines[cn.next_player] if mode == "extra": visits = cn.analysis_visits_requested + engine.config["max_visits"] - self.katrain.controls.set_status(f"Performing additional analysis to {visits} visits") + self.katrain.controls.set_status(i18n._('extra analysis').format(visits=visits)) cn.analyze(engine, visits=visits, priority=-1_000, time_limit=False) return elif mode == "sweep": @@ -348,7 +348,7 @@ class Game: if (x, y) not in stones ] visits = engine.config["fast_visits"] - self.katrain.controls.set_status(f"Refining analysis of entire board to {visits} visits") + self.katrain.controls.set_status(i18n._('sweep analysis').format(visits=visits)) priority = -1_000_000_000 else: # mode=='equalize': if not cn.analysis_ready: @@ -357,7 +357,7 @@ class Game: analyze_moves = [Move.from_gtp(gtp, player=cn.next_player) for gtp, _ in cn.analysis["moves"].items()] visits = max(d["visits"] for d in cn.analysis["moves"].values()) - self.katrain.controls.set_status(f"Equalizing analysis of candidate moves to {visits} visits") + self.katrain.controls.set_status(i18n._('equalizing analysis').format(visits=visits)) priority = -1_000 for move in analyze_moves: cn.analyze( diff --git a/katrain/i18n/locales/de/LC_MESSAGES/katrain.mo b/katrain/i18n/locales/de/LC_MESSAGES/katrain.mo index ce4c251..043f3b6 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 5e6fa27..01a6411 100644 --- a/katrain/i18n/locales/de/LC_MESSAGES/katrain.po +++ b/katrain/i18n/locales/de/LC_MESSAGES/katrain.po @@ -443,13 +443,6 @@ msgstr "" msgid "Failed to load SGF" msgstr "SGF konnte nicht geladen werden. Parse Error: {error}" -msgid "Starting default Kata failed" -msgstr "" -"Der Start von KataGo mit Befehl '{command}' ist fehlgeschlagen mit Fehler " -"{error}.Wenn unter MacOS, konsultiere das Handbuch wie brew verwendet werden" -" soll, um KataGo zu installieren und füge es dann zu deinem Pfad oder " -"'engine/katago' Einstellungenhinzu." - msgid "Starting Kata failed" msgstr "" "Der Start von KataGo mit Befehl '{command}' ist fehlgeschlagen mit Fehler " @@ -573,3 +566,36 @@ msgstr "Kalibrierter Rang" #. TODO msgid "tab:info-details" msgstr "Details" + +#. TODO +msgid "sweep analysis" +msgstr "Analyzing entire board using {visits} visits/move" + +#. TODO +msgid "Kata exe not found" +msgstr "KataGo binary {exe} does not exist, please check general settings." + +#. TODO +msgid "Kata config not found" +msgstr "" +"KataGo config file {config} does not exist, please check general settings." + +#. TODO +msgid "Kata exe not found in path" +msgstr "" +"KataGo binary `{exe}` not found in your PATH, check your environment " +"variables or use the full path in general settings instead. Wenn unter " +"MacOS, konsultiere das Handbuch wie brew verwendet werden soll, um KataGo zu" +" installieren." + +#. TODO +msgid "extra analysis" +msgstr "Performing additional analysis to {visits} visits" + +#. TODO +msgid "Kata model not found" +msgstr "KataGo model {model} does not exist, please check general settings." + +#. TODO +msgid "equalizing analysis" +msgstr "Equalizing analysis of candidate moves to {visits} visits" diff --git a/katrain/i18n/locales/en/LC_MESSAGES/katrain.mo b/katrain/i18n/locales/en/LC_MESSAGES/katrain.mo index be61dcf..1b817fd 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 0e3ff2f..3808d89 100644 --- a/katrain/i18n/locales/en/LC_MESSAGES/katrain.po +++ b/katrain/i18n/locales/en/LC_MESSAGES/katrain.po @@ -101,6 +101,18 @@ msgstr "Fast analysis of all moves" msgid "analysis:aimove" msgstr "Force AI Move" +#. status message +msgid "extra analysis" +msgstr "Performing additional analysis to {visits} visits" + +#. status message +msgid "sweep analysis" +msgstr "Analyzing entire board using {visits} visits/move" + +#. status message +msgid "equalizing analysis" +msgstr "Equalizing analysis of candidate moves to {visits} visits" + #. right panel buttons and below board msgid "pass-button-text" msgstr "Pass" @@ -446,17 +458,24 @@ msgstr "" msgid "Failed to load SGF" msgstr "Failed to load SGF. Parse Error: {error}" -msgid "Starting default Kata failed" +msgid "Kata exe not found" +msgstr "KataGo binary {exe} does not exist, please check general settings." + +msgid "Kata exe not found in path" msgstr "" -"Starting KataGo with command '{command}' failed with error {error}. If on " -"MacOS, see the manual on how to use brew to install katago first, and add it" -" to your path or 'engine/katago' setting." +"KataGo binary `{exe}` not found in your PATH, check your environment " +"variables or use the full path in general settings instead. If on MacOS, see" +" the manual on how to use brew to install katago first" + +msgid "Kata model not found" +msgstr "KataGo model {model} does not exist, please check general settings." + +msgid "Kata config not found" +msgstr "" +"KataGo config file {config} does not exist, please check general settings." msgid "Starting Kata failed" -msgstr "" -"Starting KataGo with command '{command}' failed with error {error}. Please " -"make sure the 'katago' value under 'engine' in settings points to the " -"correct KataGo executable." +msgstr "tarting KataGo with command '{command}' failed with error {error}." msgid "Engine died unexpectedly" msgstr "" diff --git a/katrain/i18n/locales/es/LC_MESSAGES/katrain.mo b/katrain/i18n/locales/es/LC_MESSAGES/katrain.mo index c0bb133..25e985a 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 e5e5142..936d3b6 100644 --- a/katrain/i18n/locales/es/LC_MESSAGES/katrain.po +++ b/katrain/i18n/locales/es/LC_MESSAGES/katrain.po @@ -441,12 +441,6 @@ msgstr "" msgid "Failed to load SGF" msgstr "Error al cargar SGF. Error de parseo: {error}" -msgid "Starting default Kata failed" -msgstr "" -"Al empezar KataGo con el comando '{command}' falla con error {error}. Si " -"estas en MacOS, ve el manual de como usar homebrew para instalar KataGo " -"primero, y ponerlo en tu ruta o en la configuración 'motor/katago'." - msgid "Starting Kata failed" msgstr "" "Empezando KataGo con el comando '{command}' fallo con error {error}. " @@ -559,20 +553,52 @@ msgstr "" "al centro. Para estrategia cuando la fase 'endgame' del tablero ha llegado." #. TODO -msgid "tab:info-details" -msgstr "Details" +msgid "aihelp:p:rank" +msgstr "" +"Picks moves at random from a limited selection of moves and plays the best " +"one. Stronger settings select the best move from a larger selection. Since " +"there is no 0 kyu/dan, 3 dan = -2 kyu." #. TODO -msgid "count down sound" -msgstr "Sound on" +msgid "Kata model not found" +msgstr "KataGo model {model} does not exist, please check general settings." + +#. TODO +msgid "equalizing analysis" +msgstr "Equalizing analysis of candidate moves to {visits} visits" + +#. TODO +msgid "Kata exe not found in path" +msgstr "" +"KataGo binary `{exe}` not found in your PATH, check your environment " +"variables or use the full path in general settings instead. Si estas en " +"MacOS, ve el manual de como usar homebrew para instalar KataGo primero" #. TODO msgid "ai:p:rank" msgstr "Calibrated Rank" #. TODO -msgid "aihelp:p:rank" +msgid "tab:info-details" +msgstr "Details" + +#. TODO +msgid "Kata exe not found" +msgstr "KataGo binary {exe} does not exist, check general settings." + +#. TODO +msgid "sweep analysis" +msgstr "Analyzing entire board using {visits} visits/move" + +#. TODO +msgid "count down sound" +msgstr "Sound on" + +#. TODO +msgid "Kata config not found" msgstr "" -"Picks moves at random from a limited selection of moves and plays the best " -"one. Stronger settings select the best move from a larger selection. Since " -"there is no 0 kyu/dan, 3 dan = -2 kyu." +"KataGo config file {config} does not exist, please check general settings." + +#. TODO +msgid "extra analysis" +msgstr "Performing additional analysis to {visits} visits" diff --git a/katrain/i18n/locales/fr/LC_MESSAGES/katrain.mo b/katrain/i18n/locales/fr/LC_MESSAGES/katrain.mo index 2dce86a..62e070a 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 cc1808e..7364bd4 100644 --- a/katrain/i18n/locales/fr/LC_MESSAGES/katrain.po +++ b/katrain/i18n/locales/fr/LC_MESSAGES/katrain.po @@ -460,11 +460,25 @@ msgstr "" msgid "Failed to load SGF" msgstr "Impossible de charger le SGF. Erreur d'analyse : {error}" -msgid "Starting default Kata failed" +#. TODO +msgid "Kata model not found" +msgstr "KataGo model {model} does not exist, please check general settings." + +#. TODO +msgid "Kata config not found" msgstr "" -"L'Erreur {error} a empêché de lancer KataGo avec la commande '{command}'. " -"Sur MacOS, consultez le manuel pour savoir comment utiliser BREW pour " -"installer KataGo, puis ajoutez-le aux paramètres ou au chemin d'accès." +"KataGo config file {config} does not exist, please check general settings." + +#. TODO +msgid "Kata exe not found in path" +msgstr "" +"KataGo binary `{exe}` not found in your PATH, check your environment " +"variables or use the full path in general settings instead. Sur MacOS, " +"consultez le manuel pour savoir comment utiliser BREW pour installer KataGo" + +#. TODO +msgid "Kata exe not found" +msgstr "KataGo binary {exe} does not exist, check general settings." msgid "Starting Kata failed" msgstr "" @@ -598,6 +612,18 @@ msgstr "" "pouvez survoler le coup pour voir la réfutation. Veuillez jouer un nouveau " "coup." +#. TODO +msgid "sweep analysis" +msgstr "Analyzing entire board using {visits} visits/move" + +#. TODO +msgid "extra analysis" +msgstr "Performing additional analysis to {visits} visits" + +#. TODO +msgid "ai:p:rank" +msgstr "Calibrated Rank" + #. TODO msgid "aihelp:p:rank" msgstr "" @@ -605,10 +631,10 @@ msgstr "" "one. Stronger settings select the best move from a larger selection. Since " "there is no 0 kyu/dan, 3 dan = -2 kyu." -#. TODO -msgid "ai:p:rank" -msgstr "Calibrated Rank" - #. TODO msgid "tab:info-details" msgstr "Details" + +#. TODO +msgid "equalizing analysis" +msgstr "Equalizing analysis of candidate moves to {visits} visits" diff --git a/katrain/i18n/locales/ko/LC_MESSAGES/katrain.mo b/katrain/i18n/locales/ko/LC_MESSAGES/katrain.mo index 3fd24aa..534e051 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 beb548f..3d8e0bf 100644 --- a/katrain/i18n/locales/ko/LC_MESSAGES/katrain.po +++ b/katrain/i18n/locales/ko/LC_MESSAGES/katrain.po @@ -435,11 +435,21 @@ msgstr "" msgid "Failed to load SGF" msgstr "SGF 파일을 불러올 수 없습니다. Parse Error: {error}" -msgid "Starting default Kata failed" +#. TODO +msgid "Kata config not found" msgstr "" -"'{command}'로 KataGo를 시작하던 중 {error} 오류가 발생했습니다. MacOS를 사용하고 계시다면, 어떻게 brew를 " -"이용해 KataGo를 설치하는지 설명서에서 확인하시고, 실행 파일을 path에 추가하거나 'engine/katago' 설정에 " -"추가하십시오." +"KataGo config file {config} does not exist, please check general settings." + +#. TODO +msgid "Kata model not found" +msgstr "KataGo Model {model} does not exist, please check general settings." + +#. TODO +msgid "Kata exe not found in path" +msgstr "" +"KataGo binary `{exe}` not found in your PATH, check your environment " +"variables or use the full path in general settings instead. MacOS를 사용하고 " +"계시다면, 어떻게 brew를 이용해 KataGo를 설치하는지 설명서에서 확인하세요." msgid "Starting Kata failed" msgstr "" @@ -553,3 +563,19 @@ msgstr "Calibrated Rank" #. TODO msgid "tab:info-details" msgstr "Details" + +#. TODO +msgid "sweep analysis" +msgstr "Analyzing entire board using {visits} visits/move" + +#. TODO +msgid "Kata exe not found" +msgstr "KataGo binary {exe} does not exist, check general settings." + +#. TODO +msgid "equalizing analysis" +msgstr "Equalizing analysis of candidate moves to {visits} visits" + +#. TODO +msgid "extra analysis" +msgstr "Performing additional analysis to {visits} visits"