-
Hello @uPagge Is there any way to translate the names of months? I mean, for example, if I am on the list of all posts in the English version of my site I have correct names. When I go to another language, let's say Polish, I still have in the same place the names of months but still in English. I assume that additional translation to the i18n file isn't enough (welp, I tried :D )and I have to change something in the code of the theme. Am I right? Thanks in advance for the help. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hello, This is how I got around this problem:
<div class="group-title-month">{{- .Key }}</div> by <div class="group-title-month">{{- i18n .Key | default .Key }}</div> It will first check for the translated name of the month, if not found it will show the default one (in English).
# === Dates translation ===
# (hacky solution until Hugo supports dates i18n)
# Months
January:
other: "Janvier"
February:
other: "Février"
March:
other: "Mars"
April:
other: "Avril"
May:
other: "Mai"
June:
other: "Juin"
July:
other: "Juillet"
August:
other: "Août"
September:
other: "Septembre"
October:
other: "Octobre"
November:
other: "Novembre"
December:
other: "Décembre" |
Beta Was this translation helpful? Give feedback.
Hello,
This is how I got around this problem:
./themes/uBlogger/layouts/_default/section.html
file to./layouts/_default/section.html
by
It will first check for the translated name of the month, if not found it will show the default one (in English).
./i18n/fr.yaml