Fix an issue with using --file argument

The following command did not work in the lang folder:
python .\update-po.py --file ./po/Firmware_cs.po

To resolve this we just extract the filename from
the path and use the constant PO_DIR to make
sure the path is always the same.
This commit is contained in:
Guðni Már Gilbert 2023-02-18 10:30:18 +00:00
parent b6ef8ea32c
commit 526e02a041
1 changed files with 1 additions and 1 deletions

View File

@ -37,7 +37,7 @@ def main():
for po_file in PO_FILE_LIST: for po_file in PO_FILE_LIST:
# Start by creating a back-up of the .po file # Start by creating a back-up of the .po file
po_file_bak = po_file.with_suffix(".bak") po_file_bak = po_file.with_suffix(".bak")
shutil.copy(PO_DIR / po_file, PO_DIR / po_file_bak) shutil.copy(PO_DIR / po_file.name, PO_DIR / po_file_bak.name)
po = polib.pofile(po_file) po = polib.pofile(po_file)
po.merge(POT_REFERENCE) po.merge(POT_REFERENCE)
po.save(po_file) po.save(po_file)