Skip to content

Commit 7d6e7bf

Browse files
authored
Update .po files generator: refresh "PO-Revision-Date" on file changes (vacanza#3160)
1 parent 8de88f2 commit 7d6e7bf

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

scripts/l10n/generate_po_files.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,16 @@ def _update_po_file(args: tuple[str, str]) -> None:
8989
po_file = pofile(po_path, wrapwidth=WRAP_WIDTH)
9090
po_file_initial = po_file.copy()
9191

92-
po_file.merge(pofile(pot_path))
92+
pot_file = pofile(pot_path)
93+
po_file.merge(pot_file)
9394
po_file.sort(key=_location_sort_key)
9495
for entry in po_file:
9596
entry.occurrences.clear()
9697

9798
# Only update the project version if po file translation entries has changed.
9899
if po_file != po_file_initial:
99100
po_file.metadata["Project-Id-Version"] = f"Holidays {package_version}"
101+
po_file.metadata["PO-Revision-Date"] = pot_file.metadata["PO-Revision-Date"]
100102

101103
# Save the file each time in order to capture all other changes properly.
102104
po_file.save(po_path, newline="\n")

0 commit comments

Comments
 (0)