Currently, we use mdbook-xgettext as a renderer, e.g., as an output format which sees the Markdown files after all of the preprocessors have run. To match this, we recommend installing the mdbook-gettext preprocessor with
[preprocessor.gettext]
after = ["links"]
This means that the mdbook-gettext preprocessor sees any files included via the built-in links preprocessor, just like the mdbook-xgettext renderer does.
This works well, and with #95 fixed, we even minimize the strings extracted this way. However, we could improve on this a bit by handling the include directives ourselves (hopefully by calling out to the links preprocessor). The advantage of this would be
Correct source lines for the translations: right now the source line points back to the Markdown file, but with a post-expansion line number.
Less updates of line numbers: if a Markdown file includes a.txt first and then b.txt, then a change to a.txt will disrupt the line numbers of all following messages. This causes unnecessary churn in the translation files.
To implement this, we should instead run mdbook-xgettext as a preprocessor, and run it before the links preprocessor.
This might of course not be worth it, especially as links.rs doesn't seem to expose it's functionality.
Currently, we use
mdbook-xgettext
as a renderer, e.g., as an output format which sees the Markdown files after all of the preprocessors have run. To match this, we recommend installing themdbook-gettext
preprocessor withThis means that the
mdbook-gettext
preprocessor sees any files included via the built-inlinks
preprocessor, just like themdbook-xgettext
renderer does.This works well, and with #95 fixed, we even minimize the strings extracted this way. However, we could improve on this a bit by handling the include directives ourselves (hopefully by calling out to the
links
preprocessor). The advantage of this would bea.txt
first and thenb.txt
, then a change toa.txt
will disrupt the line numbers of all following messages. This causes unnecessary churn in the translation files.To implement this, we should instead run
mdbook-xgettext
as a preprocessor, and run it before thelinks
preprocessor.This might of course not be worth it, especially as
links.rs
doesn't seem to expose it's functionality.