Open mgeisler opened 8 months ago
I'll pick this up since it's related to #154
Awesome, thanks @zachcmadsen!
Notably mdbook-xgettext
is also not respecting granularity for subchapters! It currently always includes line numbers when rendering messages in subchapters:
let source = ctx.config.book.src.join(&source);
for (lineno, extracted) in extract_messages(&content) {
let msgid = extracted.message;
let source = format!("{}:{}", source.display(), lineno);
add_message(catalog, &msgid, &source, &extracted.comment);
}
Putting up a fix now.
@mgeisler working on this now. How do we want the granularity to be configured? Should it be a command-line flag?
@mgeisler working on this now. How do we want the granularity to be configured? Should it be a command-line flag?
Hmm, good question! I guess there are two options:
book.toml
file — that is where the configuration should be written in the first place. We can even call Config::from_disk
from mdbook
to do this.If it's easy to replicate how mdbook
loads the config, then can could be nice. If it's not super easy, then a command line flag would be great too.
As a side-quest ( :smile: ) to #154, I've realized that
mdbook-i18n-normalize
doesn't use the same rounding logic... that will come back and cause problems at some point.It would be great to have it round the normalized message sources the same way.