From e21d34e5f0738197d1bc7565774d2a9e8a4bb6af Mon Sep 17 00:00:00 2001 From: Tim Vink Date: Mon, 16 Dec 2019 15:36:40 +0100 Subject: [PATCH] remove py37 fstrings and fix locales --- mkdocs_git_revision_date_localized_plugin/plugin.py | 13 ++++++------- setup.py | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/mkdocs_git_revision_date_localized_plugin/plugin.py b/mkdocs_git_revision_date_localized_plugin/plugin.py index bd7e0f0..2486067 100644 --- a/mkdocs_git_revision_date_localized_plugin/plugin.py +++ b/mkdocs_git_revision_date_localized_plugin/plugin.py @@ -21,23 +21,22 @@ def __init__(self): def on_config(self, config): # Get locale settings - mkdocs_locale = config.get('locale') + mkdocs_locale = self.config.get('locale') plugin_locale = self.config['locale'] - theme_locale = vars(config['theme']).get('_vars', {}).get('locale') + theme_locale = vars(self.config['theme']).get('_vars', {}).get('locale') if theme_locale is None: - theme_locale = vars(config['theme']).get('_vars', {}).get('language') + theme_locale = vars(self.config['theme']).get('_vars', {}).get('language') # First prio: plugin locale if plugin_locale != '': - if plugin_locale != mkdocs_locale: - print(f"WARNING - plugin locale setting '{plugin_locale}' will overwrite mkdocs locale '{mkdocs_locale}'") - self.locale = mkdocs_locale + self.locale = plugin_locale return # Second prio: theme if theme_locale: self.locale = theme_locale - # Third is mkdocs locale setting (might be add in the future) + + # Third is mkdocs locale setting (might be added in the future) if mkdocs_locale: self.locale = mkdocs_locale diff --git a/setup.py b/setup.py index 5b4d9e2..ed8b4e5 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setup( name='mkdocs-git-revision-date-localized-plugin', - version='0.3.3', + version='0.4', description='Mkdocs plugin that enables displaying the localized date of the last git modification of a markdown file.', long_description=long_description, long_description_content_type="text/markdown",