Closed jrappen closed 2 years ago
I assume this is due to the use of mkdocs-static-i18n
in combination with this plugin?
Hi @jrappen 👋🏻 ,
I assume you're using the mkdocs-material
theme, which has a native integration for this plugin. That means you didn't have to bother with making a theme override (see the docs how to/customize a theme for details).
If you look at https://github.com/squidfunk/mkdocs-material/blob/master/src/partials/source-file.html you should notice these two lines:
{{ lang.t("source.file.date.updated") }}:
{{ page.meta.git_revision_date_localized }}
That means the label "Letzes Update" is provided by mkdocs-material
, and depends on the language you set in your theme (see changing the language).
You now have two options:
1) Either customize the theme, and write whatever you'd like.
2) Update the translations from mkdocs-material
by updating these two lines and providing a better German translation.
1)
is a quick fix and 2)
is a long term solution I think the community would appreciate the most ;)
@timvink My question was rather, why the first part was translated but not the second.
Not sure I understand your question then. These are the translations you show:
They come from this translation file:
"source.file.date.updated": "Letztes Update",
"source.file.date.created": "Erstellt",
I don't speak German. I have contributed those lines to mkdocs-material
by using google translate (see https://github.com/squidfunk/mkdocs-material/commit/cee1eb465d4a134d7f0e23f4a4885e02ecf70052).
If you have better translation, either if you make a PR to mkdocs-material
yourself, or let me know what the translation is and I'll do it :)
@timvink Anything after the colon, as "2 months ago" in this case, isn't translated. It remains in English.
Ohhh I see, I thought the second part was the Erstellt: 2 month ago
that was not translated properly.
I looked at your website, and changing language: en
to language: de
here should solve it:
https://github.com/jrappen/recipes/blob/c67e90f1500fad82e2a7d6c55b053c9278f103f2/mkdocs.yml#L18
I think the core issue is that this plugin does not support the mkdocs-static-i18n
plugin, more specifically, there's no support for defining the lang: de
in the YAML frontmatter as you do f.e. here: https://raw.githubusercontent.com/jrappen/recipes/main/docs/src/markdown/cookies.de.md
That should be there. I'll look into it next time I work on the plugin, probably somewhere next weekend.
@timvink Changing from theme: language:en
to theme: language: de
will only fix it for German pages, but probably break it for English pages as a result. I assume this is because @squidfunk 's mkdocs-material
theme only accepts a "global" language setting for the whole site.
Yes, this plugin also only supports a global language setting. I will build in support for per-page language setting.
I have this test site:
where my last commit to
main
was built with:and pages with the German language have footers of this plugin only partially translated:
Any feedback as to why this happens?