timvink / mkdocs-git-revision-date-localized-plugin

MkDocs plugin to add a last updated date to your site pages
https://timvink.github.io/mkdocs-git-revision-date-localized-plugin/index.html
MIT License
206 stars 44 forks source link

Formatted date is not localized #21

Closed Guts closed 4 years ago

Guts commented 4 years ago

Reproduce

Lets' use the fixtures used in tests, just moving from nl to fr to see more obvious difference:

  1. set locale in config:
site_name: test gitrevisiondatelocalized_plugin
use_directory_urls: true

locale: fr

plugins:
    - search
    - git-revision-date-localized
  1. Serve site : mkdocs serve -f .\tests\basic_setup\mkdocs_locale.yml
  2. Date is not localized:

image

Expected result

image

Debug

The error is located in this line:

https://github.com/timvink/mkdocs-git-revision-date-localized-plugin/blob/2f8dc73ffc033d68e310441f0f8fc79ba27e6858/mkdocs_git_revision_date_localized_plugin/util.py#L81

Should pass the inherited locale:

return self._date_formats(unix_timestamp=unix_timestamp, locale=locale)