Why does MkDocs Material not use MkDocs standard locale config key? #7446
-
On MkDocs documentation, to configure the language you have this: theme:
name: mkdocs
locale: fr On the other hand on MkDocs Material you have this: theme:
name: material
language: en So for any multilingual plugins one should test both cases: from toolz.dicttoolz import get_in
lang = (
get_in(["theme", "language"], config)
or get_in(["theme", "locale"], config)
or get_in(["plugins", "search", "lang"], config)
or "en"
) Is there any particular reason why the setting does not follow MkDocs standard? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hello @yves-chevallier,
So many people used |
Beta Was this translation helpful? Give feedback.
Hello @yves-chevallier,
most likely since Material for MkDocs had
language
years before MkDocs hadlocale
:So many people used
language
instead oflocale
in their configuration, so there could be some sort of regressions when changing it.If I remember correctly, different language code formats are also used, one uses
-
and the other_
to separate sublanguages, but I could be wrong here.The
base.html
could in theory create a mapping oflocale
tolanguage
and vice-versa internally for the theme to allow for both syntaxes,…