From 0742d635af70e13f6d6998d6184c2d6757eaf5f1 Mon Sep 17 00:00:00 2001 From: misyaguziya Date: Sun, 7 Jan 2024 01:43:50 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=8D[Update]=20Model=20:=20DeepL=5FAPI?= =?UTF-8?q?=E3=81=AE=E8=AA=8D=E8=A8=BC=E5=87=A6=E7=90=86=E3=81=AE=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.py | 3 --- controller.py | 15 +++++++-------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/config.py b/config.py index 93e70c2d..e206305d 100644 --- a/config.py +++ b/config.py @@ -649,9 +649,6 @@ class Config: self._OSC_PORT = 9000 self._AUTH_KEYS = { "DeepL_API": None, - "DeepL": None, - "Bing": None, - "Google": None, } self._WEIGHT_TYPE = "small" self._MESSAGE_FORMAT = "[message]([translation])" diff --git a/controller.py b/controller.py index fceebc2c..05c3cb91 100644 --- a/controller.py +++ b/controller.py @@ -728,14 +728,13 @@ def createMainWindow(): initSetTranslateEngine() initSetLanguageAndCountry() - # if (config.SELECTED_TAB_YOUR_TRANSLATOR_ENGINES[config.SELECTED_TAB_NO] == "DeepL_API" or - # config.SELECTED_TAB_TARGET_TRANSLATOR_ENGINES[config.SELECTED_TAB_NO] == "DeepL_API"): - # if model.authenticationTranslator("DeepL_API", config.AUTH_KEYS["DeepL_API"]) is False: - # # error update Auth key - # auth_keys = config.AUTH_KEYS - # auth_keys["DeepL_API"] = None - # config.AUTH_KEYS = auth_keys - # view.printToTextbox_AuthenticationError() + if config.AUTH_KEYS["DeepL_API"] is not None: + if model.authenticationTranslatorDeepLAuthKey("DeepL_API", config.AUTH_KEYS["DeepL_API"]) is False: + # error update Auth key + auth_keys = config.AUTH_KEYS + auth_keys["DeepL_API"] = None + config.AUTH_KEYS = auth_keys + view.printToTextbox_AuthenticationError() # set word filter model.addKeywords()