Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: default to localized date formatting #1552

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

David-Guillot
Copy link

@David-Guillot David-Guillot commented Jul 9, 2024

What does this PR change? What problem does it solve?

On a multilingual blog with translated posts, a non-English post displays an English-formatted non-English date like
juillet 8, 2024 instead of 8 juillet 2024 as it should be for French.

This PR changes the post_meta partial template to leverage Hugo's time.Format function's preset formats. I have chosen :date_long since it's the one that was hard-coded here before.

Was the change discussed in an issue or in the Discussions before?

Nope, I just discovered this behavior and considered it a bug, so I just took the liberty of opening a PR. This PR fixes the same problem as #1111 though, but without any additional code, just using native Hugo features.

And actually I just created #1611 for you to have a clear view on the issue. This PR fixes the issue on both places because as you know the post_meta.html template is included both in list.html and in single.html.

PR Checklist

  • This change adds/updates translations and I have used the template present here.
  • I have enabled maintainer edits for this PR.
  • I have verified that the code works as described/as intended.
  • This change adds a Social Icon which has a permissive license to use it.
  • This change does not include any CDN resources/links.
  • This change does not include any unrelated scripts such as bash and python scripts.
  • This change updates the overridden internal templates from HUGO's repository.

@David-Guillot David-Guillot changed the title fix(post_meta): default to localized date formatting fix #1611: default to localized date formatting Oct 7, 2024
@David-Guillot David-Guillot changed the title fix #1611: default to localized date formatting fix: default to localized date formatting Oct 7, 2024
Copy link

sonarcloud bot commented Oct 7, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant