diff --git a/lang/update-po.py b/lang/update-po.py index 98aaef18d..a1e07da55 100644 --- a/lang/update-po.py +++ b/lang/update-po.py @@ -6,6 +6,7 @@ Portable script to update po files on most platforms import argparse from sys import stderr, exit +import shutil from pathlib import Path import polib from polib import POFile @@ -34,6 +35,9 @@ def main(): return 1 for po_file in PO_FILE_LIST: + # Start by creating a back-up of the .po file + po_file_bak = po_file.with_suffix(".bak") + shutil.copy(PO_DIR / po_file, PO_DIR / po_file_bak) po = polib.pofile(po_file) po.merge(POT_REFERENCE) po.save(po_file)