File tree Expand file tree Collapse file tree 1 file changed +12
-9
lines changed
mkdocs_git_revision_date_localized_plugin Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -21,26 +21,29 @@ def __init__(self):
21
21
def on_config (self , config ):
22
22
23
23
# Get locale settings
24
- mkdocs_locale = self . config .get ('locale' )
24
+ mkdocs_locale = config .get ('locale' )
25
25
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' )
27
28
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
29
35
30
- # First prio: plugin locale
36
+ # Second prio: plugin locale
31
37
if plugin_locale != '' :
32
38
self .locale = plugin_locale
33
39
return
34
40
35
- # Second prio: theme
36
- if theme_locale :
37
- self .locale = theme_locale
38
-
39
41
# Third is mkdocs locale setting (might be added in the future)
40
42
if mkdocs_locale :
41
43
self .locale = mkdocs_locale
42
44
43
- # Final fallback is english
45
+ # If none set then english
46
+ self .locale = 'en'
44
47
return
45
48
46
49
You can’t perform that action at this time.
0 commit comments