Is there a way to use german month names for all dates on the website?
In the config.toml I definded the defaultContentLanguage as “de”.
I can customize the date format but not the month names.
In the i18n is no entry for the months.
Is there a way to use german month names for all dates on the website?
In the config.toml I definded the defaultContentLanguage as “de”.
I can customize the date format but not the month names.
In the i18n is no entry for the months.
I believe you’re asking about localization (l10n). Hugo doesn’t currently have a framework for that.
Here’s how I did it:
data/months_german.toml
:
"1" = "Januar"
"2" = "Februar"
"3" = "März"
"4" = "April"
"5" = "Mai"
"6" = "Juni"
"7" = "Juli"
"8" = "August"
"9" = "September"
"10" = "Oktober"
"11" = "November"
"12" = "Dezember"
And in the template:
{{ index site.Data.months_german (printf "%d" .Date.Month) }} {{ .Date.Year }}
Hope this helps.
What if I need Jänner in the Austrian localization?
troll
Nicht möglich
seufzs
I am new to this topic. Which one is the template file? Is it the used theme?
Hi @Leo_Merkel
Thanks!! I have some questions:
Kindest Regards