Description
We currently work with monolithic file: mdbook-xgettext
writes all messages to a single POT file (typically messages.pot
) and mdbook-gettext
read a single PO file as well. We've seen in Comprehensive Rust how these files can grow very large: the PO files are around 800 kB and 24k lines in size.
It would be interesting to support splitting the POT file into smaller units. We could let the book outline decide the splitting and split on each top-level chapter. More elegantly, we could have a splitting depth: the current behavior would be splitting at depth 0, depth 1 would split at top-level chapters, depth 2 would go one level further, etc.
This could in principle be implemented today by scripting calls to msggrep --location
(to split the POT file into smaller units) and msgcat
(to compile multiple PO files). However, a native solution will likely be cleaner overall. The splitting with msggrep
and combining with msgcat
suggests an implementation strategy: keep everything like today, and split the Catalog
into units before saving them in mdbook-xgettext
. Similarly, create a large Catalog
from many smaller ones in mdbook-gettext
.
Activity