Skip to content

Commit 47da220

Browse files
committed
fix bug in key index
1 parent e21d34e commit 47da220

File tree

1 file changed

+12
-9
lines changed
  • mkdocs_git_revision_date_localized_plugin

1 file changed

+12
-9
lines changed

mkdocs_git_revision_date_localized_plugin/plugin.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,26 +21,29 @@ def __init__(self):
2121
def on_config(self, config):
2222

2323
# Get locale settings
24-
mkdocs_locale = self.config.get('locale')
24+
mkdocs_locale = config.get('locale')
2525
plugin_locale = self.config['locale']
26-
theme_locale = vars(self.config['theme']).get('_vars', {}).get('locale')
26+
27+
theme_locale = vars(config['theme']).get('_vars', {}).get('locale')
2728
if theme_locale is None:
28-
theme_locale = vars(self.config['theme']).get('_vars', {}).get('language')
29+
theme_locale = vars(config['theme']).get('_vars', {}).get('language')
30+
31+
# First prio: theme
32+
if theme_locale:
33+
self.locale = theme_locale
34+
return
2935

30-
# First prio: plugin locale
36+
# Second prio: plugin locale
3137
if plugin_locale != '':
3238
self.locale = plugin_locale
3339
return
3440

35-
# Second prio: theme
36-
if theme_locale:
37-
self.locale = theme_locale
38-
3941
# Third is mkdocs locale setting (might be added in the future)
4042
if mkdocs_locale:
4143
self.locale = mkdocs_locale
4244

43-
# Final fallback is english
45+
# If none set then english
46+
self.locale = 'en'
4447
return
4548

4649

0 commit comments

Comments
 (0)