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
127 stars 25 forks source link

Set POT-Creation-Date in newly generated POT files #87

Closed mgeisler closed 11 months ago

mgeisler commented 11 months ago

The data is added to PO files automatically by msgmerge. This will in turn be used when publishing a translation: it allows us to know which sources goes into a given PO file.

Part of #16.

mgeisler commented 11 months ago

@sakex, I'm thinking we should surface this field in the template engine. That way we can write something like

Published on {{ now() }}, translation current as of {{ pot-creation-date }}.

in the footer of each page.

sakex commented 11 months ago

Sure, this can be done by adding the variable to the book object at the gettext preprocessor step, then we'll retrieve it from a custom template

mgeisler commented 11 months ago

Sure, this can be done by adding the variable to the book object at the gettext preprocessor step

Oh, interesting! Can a preprocessor modify the metadata passed onto later preprocessors and renderers? I was thinking it should become a context variable for the template engine.

sakex commented 11 months ago

Yes actually, we could just pass time.now from the renderer On Sep 25, 2023 08:56, Martin Geisler @.***> wrote:

Sure, this can be done by adding the variable to the book object at the gettext preprocessor step

Oh, interesting! Can a preprocessor modify the metadata passed onto later preprocessors and renderers? I was thinking it should become a context variable for the template engine.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

mgeisler commented 11 months ago

See https://github.com/google/comprehensive-rust/pull/1243 for the other half of this: updating the the data in POT-Creation-Date when publishing a book.