Skip to content

Blog plugin error with date convertion with pt-BR language #6328

@vmutter

Description

@vmutter

Context

No response

Bug description

Using the blog plugin with the language set to pt-BR, there is a problem with the babel format_date, with the given locale.

The locale is set by getting the langauge config, in this case pt-BR, but babel does not support the hifen (it must be an undescore). So ther error happens.

Line 803 from https://github.com/squidfunk/mkdocs-material/blob/master/src/plugins/blog/plugin.py

This error problably happens with other languages with hifen (e.g. ku-IQ)

The solution would be to replace the hifen (-) with (_)

Related links

Reproduction

9.4.8-bug-blog-pt-br.zip

Steps to reproduce

  1. Setting up a blog
  2. Start the mkdocs, using docker: docker run --rm -it -p 8000:8000 -v ${PWD}:/docs squidfunk/mkdocs-material

Browser

Chrome

Before submitting

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue reports a bugresolvedIssue is resolved, yet unreleased if open

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions