Skip to content

Commit e21d34e

Browse files
committed
remove py37 fstrings and fix locales
1 parent 867307f commit e21d34e

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

mkdocs_git_revision_date_localized_plugin/plugin.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,22 @@ def __init__(self):
2121
def on_config(self, config):
2222

2323
# Get locale settings
24-
mkdocs_locale = config.get('locale')
24+
mkdocs_locale = self.config.get('locale')
2525
plugin_locale = self.config['locale']
26-
theme_locale = vars(config['theme']).get('_vars', {}).get('locale')
26+
theme_locale = vars(self.config['theme']).get('_vars', {}).get('locale')
2727
if theme_locale is None:
28-
theme_locale = vars(config['theme']).get('_vars', {}).get('language')
28+
theme_locale = vars(self.config['theme']).get('_vars', {}).get('language')
2929

3030
# First prio: plugin locale
3131
if plugin_locale != '':
32-
if plugin_locale != mkdocs_locale:
33-
print(f"WARNING - plugin locale setting '{plugin_locale}' will overwrite mkdocs locale '{mkdocs_locale}'")
34-
self.locale = mkdocs_locale
32+
self.locale = plugin_locale
3533
return
3634

3735
# Second prio: theme
3836
if theme_locale:
3937
self.locale = theme_locale
40-
# Third is mkdocs locale setting (might be add in the future)
38+
39+
# Third is mkdocs locale setting (might be added in the future)
4140
if mkdocs_locale:
4241
self.locale = mkdocs_locale
4342

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setup(
77
name='mkdocs-git-revision-date-localized-plugin',
8-
version='0.3.3',
8+
version='0.4',
99
description='Mkdocs plugin that enables displaying the localized date of the last git modification of a markdown file.',
1010
long_description=long_description,
1111
long_description_content_type="text/markdown",

0 commit comments

Comments
 (0)