From 9c73460e2c5d261be0ac5811a0e06ffdc9ab2784 Mon Sep 17 00:00:00 2001 From: squidfunk Date: Tue, 14 Nov 2023 09:33:48 +0100 Subject: [PATCH] Fixed blog plugin crashing for pt-BR locale --- material/plugins/blog/plugin.py | 2 +- src/plugins/blog/plugin.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/material/plugins/blog/plugin.py b/material/plugins/blog/plugin.py index 375b8cfe7..7d2e5595f 100644 --- a/material/plugins/blog/plugin.py +++ b/material/plugins/blog/plugin.py @@ -800,7 +800,7 @@ class BlogPlugin(BasePlugin[BlogConfig]): # Format date def _format_date(self, date: datetime, format: str, config: MkDocsConfig): - locale = config.theme["language"] + locale: str = config.theme["language"].replace("-", "_") return format_date(date, format = format, locale = locale) # Format date for post diff --git a/src/plugins/blog/plugin.py b/src/plugins/blog/plugin.py index 375b8cfe7..7d2e5595f 100644 --- a/src/plugins/blog/plugin.py +++ b/src/plugins/blog/plugin.py @@ -800,7 +800,7 @@ class BlogPlugin(BasePlugin[BlogConfig]): # Format date def _format_date(self, date: datetime, format: str, config: MkDocsConfig): - locale = config.theme["language"] + locale: str = config.theme["language"].replace("-", "_") return format_date(date, format = format, locale = locale) # Format date for post