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: frOn the other hand on MkDocs Material you have this: theme:
name: material
language: enSo 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
languageyears before MkDocs hadlocale:So many people used
languageinstead oflocalein 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.htmlcould in theory create a mapping oflocaletolanguageand vice-versa internally for the theme to allow for both syntaxes,…