From 773dc864435443f66177565a620ef394518ed2a6 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: Wed, 31 Jul 2024 18:23:47 +0800 Subject: [PATCH] fix --- LunaTranslator/LunaTranslator/myutils/utils.py | 5 ++++- LunaTranslator/LunaTranslator/transoptimi/noundict.py | 2 +- LunaTranslator/files/defaultconfig/static_data.json | 5 ++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/LunaTranslator/LunaTranslator/myutils/utils.py b/LunaTranslator/LunaTranslator/myutils/utils.py index a82a7bb3..bf2d844c 100644 --- a/LunaTranslator/LunaTranslator/myutils/utils.py +++ b/LunaTranslator/LunaTranslator/myutils/utils.py @@ -562,7 +562,10 @@ def checkpostlangmatch(name): for item in static_data["transoptimi"]: if name == item["name"]: try: - return getlanguse() == item["languageuse"] + if isinstance(item["languageuse"], list): + return getlanguse() in item["languageuse"] + elif isinstance(item["languageuse"], str): + return getlanguse() == item["languageuse"] except: return True diff --git a/LunaTranslator/LunaTranslator/transoptimi/noundict.py b/LunaTranslator/LunaTranslator/transoptimi/noundict.py index 51d31989..56dc7bc7 100644 --- a/LunaTranslator/LunaTranslator/transoptimi/noundict.py +++ b/LunaTranslator/LunaTranslator/transoptimi/noundict.py @@ -367,7 +367,7 @@ class Process: noundictconfigdialog_private( parent_window, savehook_new_data[gameuid]["noundictconfig"], - "专有名词翻译_直接替换_占位符", + "专有名词翻译_占位符", ), ) diff --git a/LunaTranslator/files/defaultconfig/static_data.json b/LunaTranslator/files/defaultconfig/static_data.json index 2f1b9462..d95dacd9 100644 --- a/LunaTranslator/files/defaultconfig/static_data.json +++ b/LunaTranslator/files/defaultconfig/static_data.json @@ -1856,7 +1856,10 @@ { "name": "gptpromptdict", "visname": "专有名词翻译_sakura_gpt_词典", - "languageuse": "zh" + "languageuse": [ + "zh", + "cht" + ] }, { "name": "transerrorfix",