Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Splitting translation files for mdBook preprocessor #2

Open
ISSOtm opened this issue Aug 12, 2022 · 0 comments
Open

Splitting translation files for mdBook preprocessor #2

ISSOtm opened this issue Aug 12, 2022 · 0 comments

Comments

@ISSOtm
Copy link

ISSOtm commented Aug 12, 2022

Hi! I'm looking to use mdTranslation and mdbook-translation for ISSOtm/gb-asm-tutorial#25.

Unfortunately, given that the book is quite large, a single translation file per language is infeasible, much less so one for all translations (as nice as the "many languages per translation file" feature is, I don't think it's useful for this use case). Hence, I would prefer if the preproc read one translation file per input file (i.e. the translation files would be arranged following the same structure as the book's source).

Here's a command to generate the translation files:

$ git ls-files -z src | sed -Ez 's,src/(.+\.md)$,\1,;t;d' | xargs -0I {} bash -c 'mkdir -p "$(dirname "translations/@@LANG@@/{}")" && mdtranslation_extract -l @@LANG@@ "src/{}" >"translations/@@LANG@@/{}"'

(Replacing @@LANG@@ with the language of your choice, of course.)

Would you be interested in upstreaming such changes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant