Skip to content

Commit

Permalink
Added better fuzzy
Browse files Browse the repository at this point in the history
  • Loading branch information
pescheck-bram committed Nov 30, 2023
1 parent 2c7ae14 commit 4a7ee48
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions python_gpt_po/po_translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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', '')
Expand All @@ -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 = [
Expand Down

0 comments on commit 4a7ee48

Please sign in to comment.