Make --no-overwrite still overwrite fuzzies.

This commit is contained in:
Julien Palard 2023-03-22 23:02:02 +01:00
parent fa83920923
commit 445fa03c1e
Signed by: mdk
GPG Key ID: 0EFC1AC1006886F8
1 changed files with 2 additions and 2 deletions

View File

@ -55,7 +55,7 @@ def write_translations(
for po_file in tqdm(files, desc="Updating translations"): for po_file in tqdm(files, desc="Updating translations"):
po_file = polib.pofile(po_file) po_file = polib.pofile(po_file)
for entry in po_file: for entry in po_file:
if not overwrite and entry.msgstr: if not overwrite and entry.msgstr and "fuzzy" not in entry.flags:
continue continue
if ( if (
entry.msgid in translations entry.msgid in translations
@ -138,7 +138,7 @@ is equivalent to:
"-n", "-n",
action="store_true", action="store_true",
help="When applying translation, " help="When applying translation, "
"do not overwrite existing translations (apply only to untranslated ones).", "do not overwrite existing translations (apply only to untranslated or fuzzy ones).",
) )
parser.add_argument( parser.add_argument(