From b300b57e53bd1a5149eedb2a31d19abc207a2171 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=81=8D=E5=85=AE=E6=83=9A=E5=85=AE?= <101191390+HIllya51@users.noreply.github.com> Date: Mon, 20 May 2024 00:40:55 +0800 Subject: [PATCH] fix --- .../LunaTranslator/myutils/config.py | 18 ++++++++++++------ LunaTranslator/files/defaultconfig/config.json | 2 +- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/LunaTranslator/LunaTranslator/myutils/config.py b/LunaTranslator/LunaTranslator/myutils/config.py index 790f2609..a02de560 100644 --- a/LunaTranslator/LunaTranslator/myutils/config.py +++ b/LunaTranslator/LunaTranslator/myutils/config.py @@ -139,13 +139,16 @@ def syncconfig(config1, default, drop=False, deep=0, skipdict=False): elif key == "name": config1[key] = default[key] - if type(default[key]) != type(config1[key]) and ( - type(default[key]) == dict or type(default[key]) == list - ): + elif key == "argstype": config1[key] = default[key] - elif type(default[key]) == dict: - if skipdict == False: - syncconfig(config1[key], default[key], drop, deep - 1) + else: + if type(default[key]) != type(config1[key]) and ( + type(default[key]) == dict or type(default[key]) == list + ): + config1[key] = default[key] + elif type(default[key]) == dict: + if skipdict == False: + syncconfig(config1[key], default[key], drop, deep - 1) if drop and deep > 0: for key in list(config1.keys()): @@ -191,12 +194,15 @@ def getlanguse(): global language, languageshow return static_data["language_list_translator_inner"][language] + def getlangsrc(): return static_data["language_list_translator_inner"][globalconfig["srclang3"]] + def getlangtgt(): return static_data["language_list_translator_inner"][globalconfig["tgtlang3"]] + def setlanguage(): global language, languageshow language = globalconfig["languageuse"] diff --git a/LunaTranslator/files/defaultconfig/config.json b/LunaTranslator/files/defaultconfig/config.json index 94fa9535..88175307 100644 --- a/LunaTranslator/files/defaultconfig/config.json +++ b/LunaTranslator/files/defaultconfig/config.json @@ -946,7 +946,7 @@ "name": "路径", "dir": false, "multi": true, - "filter": "*.mdx|*.mdd" + "filter": "*.mdx;*.mdd" }, "ambiguity": { "type": "intspin",