From 4a7ee489e25210770f1e00da1decf12b7dacfac1 Mon Sep 17 00:00:00 2001 From: Bram Mittendorff Date: Thu, 30 Nov 2023 17:28:55 +0100 Subject: [PATCH] Added better fuzzy --- python_gpt_po/po_translator.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/python_gpt_po/po_translator.py b/python_gpt_po/po_translator.py index 3099ccd..cc38144 100644 --- a/python_gpt_po/po_translator.py +++ b/python_gpt_po/po_translator.py @@ -82,6 +82,8 @@ def scan_and_process_po_files(self, input_folder, languages): def process_po_file(self, po_file_path, languages): """Processes an individual .po file by removing fuzzy entries if specified.""" + if self.config.fuzzy: + self.remove_fuzzy_entries_with_polib(po_file_path) try: po_file = polib.pofile(po_file_path) file_lang = po_file.metadata.get('Language', '') @@ -103,9 +105,6 @@ def process_po_file(self, po_file_path, languages): return if file_lang in languages: - if self.config.fuzzy: - self.remove_fuzzy_entries_with_polib(po_file_path) - # Reload the po file after modifications po_file = polib.pofile(po_file_path) texts_to_translate = [