Issue with MultiLingual Date/Time Format

Trying to figure out why my date/time format doesn’t show localized date times. I have used the right locale I believe: Here is my config/languages/languages.fr-fr.toml and my page calling the date time respectively. I have tried both uppercase and lowercase using the list here : Hugo Locales

contentDir = 'content/fr-fr'
languageName = 'Français'
weight = 20
languageCode = 'fr_FR'
locale = 'fr_FR'
{{with .Date}} <div >{{ . | time.Format  ":date_full"  }}</div>{{end}}
defaultContentLanguage = 'fr-fr'

[languages.fr-fr]
contentDir = 'content/fr-fr'
languageCode = 'fr-FR'
languageName = 'Français'
weight = 10

If you don’t care about localizing to a particular country, you can do this:

defaultContentLanguage = 'fr'

[languages.fr]
contentDir = 'content/fr'
languageCode = 'fr-FR'
languageName = 'Français'
weight = 10

The languageCode is currently used in two places only: the internal RSS template, and the internal alias template (as of this morning). If you are using a theme developed by a third party, it may be used other places as well. But languageCode is not used as a key for either translation or localization.

The locale key is not a thing.

1 Like

As it is still not working, I have done something entirely unheard of for me up to this point:

I looked at your example, and I don’t know where to begin. Instead, how about looking at this working example, and then you can figure out what’s different…

git clone --single-branch -b hugo-forum-topic-37575 https://github.com/jmooring/hugo-testing hugo-forum-topic-37575
cd hugo-forum-topic-37575
hugo server
1 Like

I found my issue and it was, shamefully, that I hadn’t update the hugo version in my docker image.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.