From a913314951ebde7e4af479a1013a05e19af507c7 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, 15 Jul 2024 17:21:13 +0800 Subject: [PATCH] fix --- LunaTranslator/LunaTranslator/myutils/commonbase.py | 8 ++++++++ LunaTranslator/LunaTranslator/ocrengines/baseocrclass.py | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/LunaTranslator/LunaTranslator/myutils/commonbase.py b/LunaTranslator/LunaTranslator/myutils/commonbase.py index 96939a87..b224efc8 100644 --- a/LunaTranslator/LunaTranslator/myutils/commonbase.py +++ b/LunaTranslator/LunaTranslator/myutils/commonbase.py @@ -40,6 +40,14 @@ class commonbase: except: return "" + @property + def srclang_1(self): + try: + l = getlangsrc() + return l + except: + return "" + @property def tgtlang(self): try: diff --git a/LunaTranslator/LunaTranslator/ocrengines/baseocrclass.py b/LunaTranslator/LunaTranslator/ocrengines/baseocrclass.py index 22689072..18d33570 100644 --- a/LunaTranslator/LunaTranslator/ocrengines/baseocrclass.py +++ b/LunaTranslator/LunaTranslator/ocrengines/baseocrclass.py @@ -21,7 +21,7 @@ class baseocr(commonbase): def space(self): if globalconfig["ocrmergelines"] == False: space = "\n" - elif self.srclang in ["zh", "ja", "cht"]: + elif self.srclang_1 in ["zh", "ja", "cht"]: space = "" else: space = " "