From fd4f61e601349ae69f31aab6a71b337090e79b3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Sun, 19 May 2024 19:47:06 +0200 Subject: [PATCH] Fix performance regression in `copy_fix.py` --- scripts/languages/copy_fix.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/languages/copy_fix.py b/scripts/languages/copy_fix.py index d80b40a05..944f16c57 100755 --- a/scripts/languages/copy_fix.py +++ b/scripts/languages/copy_fix.py @@ -8,7 +8,10 @@ def copy_fix(infile, delete_unused, append_missing, delete_empty): with open(infile, encoding="utf-8") as f: content = f.readlines() trans = twlang.translations(infile) - local = twlang.localizes() + if delete_unused or append_missing: + local = twlang.localizes() + else: + local = [] supported = [] for tran, (start, expr, end) in trans.items(): if delete_unused and tran not in local: