google / mdbook-i18n-helpers

Translation support for mdbook. The plugins here give you a structured way to maintain a translated book.
Apache License 2.0
126 stars 25 forks source link

Advance POT-Creation-Date by 1 second in `mdbook-i18n-normalize` #117

Closed mgeisler closed 1 month ago

mgeisler commented 9 months ago

When mdbook-i18n-normalize is used on a PO file, we currently leave the metadata alone. However, this can cause problems for publishing pipelines like the one in Comprehensive Rust: there we expect that the POT-Creation-Date field has changed if any of the msgid fields change.

To handle this situation in a smooth way, I propose incrementing the timestamp by 1 second, if possible. This means: parse the field, increment it by 1 second if it's a valid timestamp, and finally write it back to the file. If it's missing or invalid, then leave it along.