From b6ef8ea32c34d140e86df248e3b8e37fa3d29707 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= Date: Sat, 18 Feb 2023 10:13:34 +0000 Subject: [PATCH] Add a backup of po files --- lang/update-po.py | 4 ++++ 1 file changed, 4 insertions(+) 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)