Skip to content

Commit ad78b99

Browse files
authored
Merge pull request #143 from Xiaokang2022/master
Fixed the bug that the configuration option `theme.language` in mkdocs.yml was not fetched correctly under the `mkdocs-material` theme
2 parents b227ce8 + 2f7ef02 commit ad78b99

File tree

1 file changed

+4
-4
lines changed
  • mkdocs_git_revision_date_localized_plugin

1 file changed

+4
-4
lines changed

mkdocs_git_revision_date_localized_plugin/plugin.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,16 @@ def on_config(self, config: config_options.Config, **kwargs) -> Dict[str, Any]:
7676
plugin_locale = self.config.get("locale", None)
7777

7878
# theme locale
79-
if "theme" in config and "locale" in config.get("theme"):
79+
if "theme" in config and "language" in config.get("theme"):
8080
custom_theme = config.get("theme")
81-
theme_locale = custom_theme.locale if Version(mkdocs_version) >= Version("1.6.0") else custom_theme._vars.get("locale")
81+
theme_locale = custom_theme._vars.get("language")
8282
logging.debug(
8383
"Locale '%s' extracted from the custom theme: '%s'"
8484
% (theme_locale, custom_theme.name)
8585
)
86-
elif "theme" in config and "language" in config.get("theme"):
86+
elif "theme" in config and "locale" in config.get("theme"):
8787
custom_theme = config.get("theme")
88-
theme_locale = custom_theme._vars.get("language")
88+
theme_locale = custom_theme.locale if Version(mkdocs_version) >= Version("1.6.0") else custom_theme._vars.get("locale")
8989
logging.debug(
9090
"Locale '%s' extracted from the custom theme: '%s'"
9191
% (theme_locale, custom_theme.name)

0 commit comments

Comments
 (0)