Closed michalfapso closed 8 months ago
Thanks for this amazing work @michalfapso
I'd rather you add tests to a separate tree so that it's strictly related to the feature and easier to cope with
Please rebase
Sure, now I've pushed a rebased commit with tests included.
@michalfapso I forgot to ask sorry but could you share a rationale of the problem you're trying to solve with an example as to why it's not possible currently?
Sure, @ultrabug, I have a documentation in English with quite a lot of admonitions. Then I have auto-translated it to several other languages which would be later manually corrected by a community. I'm using the material theme and your static-i18n plugin for it.
When I have !!! tip
in my English documentation it gets rendered as "Tip" (as seen here: https://squidfunk.github.io/mkdocs-material/reference/admonitions/#supported-types). To translate it to another language I can write !!! tip "Conseil"
which replaces the admonition title with "Conseil", but I would prefer to have a translation map for each admonition type so that its translated across the whole documentation consistently.
I could have written a separate script just to post process all markdown files and to add the translation of admonition titles directly to them, but I prefer not having those translations hard coded in all markdowns.
I already have some strings translated via nav_translations
, so I find it convenient to have the proposed admonition_tranlstations
right beside it in the mkdocs.yml
.
Here are some related requests: https://github.com/squidfunk/mkdocs-material/discussions/4599 https://github.com/squidfunk/mkdocs-material/issues/749
Makes sense and I'm honored that the plugin could help people find a solution to a 2018 problem :+1: thanks
Please check my comments
Thanks for your comments, @ultrabug. I've tried to apply them in a new commit.
Do you prefer having separate commits of these subsequent changes or should I rebase and keep it in a single commit?
Do you prefer having separate commits of these subsequent changes or should I rebase and keep it in a single commit?
Rebase please, or I'll squash & merge np
Almost there!
All green, one final review and we should be good to go
Thanks and congratulations again @michalfapso
Thanks a lot, @ultrabug! It was my pleasure :)
Thanks a lot for working on this project!
I have a documentation with multiple languages and I was looking for a way to translate admonitions.
I wasn't sure how should I add a test for it, whether to add an admonition into
tests/docs_*_two_languages
or should I create a separate testing doc?