From 03c4883afa4219d0efbdd013ff4ef8dd222d514d Mon Sep 17 00:00:00 2001 From: awwaawwa <8493196+awwaawwa@users.noreply.github.com> Date: Sat, 28 Dec 2024 11:51:40 +0800 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor(translator):=20Co?= =?UTF-8?q?ntinue=20writing=20to=20cache=20after=20setting=20the=20ignore?= =?UTF-8?q?=20cache=20flag.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pdf2zh/translator.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pdf2zh/translator.py b/pdf2zh/translator.py index 3f34de59..57b2a15a 100644 --- a/pdf2zh/translator.py +++ b/pdf2zh/translator.py @@ -78,8 +78,7 @@ def translate(self, text, ignore_cache=False): return cache translation = self.do_translate(text) - if not (self.ignore_cache or ignore_cache): - self.cache.set(text, translation) + self.cache.set(text, translation) return translation def do_translate(self, text):