Can anyone help me understand why my blog at https://cesco.blog isn’t working correctly with internationalization (i18n)? I’m trying to translate messages from English to Italian.
I’ve set "defaultContentLanguage": "it"
in the config.json
file and created an it.json
file in the i18n
folder.
For translation, I’m using {{ i18n "<Value>" }}
or the shortcut {{ T "<Value>" }}
. This is a brief snippet of my code:
i18n/it.json:
{
"Archive": "Archivio",
"Full Post List": "Lista completa degli articoli",
"Hosted by <a href=\"https://micro.blog\">Micro.blog</a>": "Ospitato da <a href=\"https://micro.blog\">Micro.blog</a>",
"Powered by <a href=\"https://sumo.micro.blog\">Sumo Theme</a>": "Realizzato con <a href=\"https://sumo.micro.blog\">Sumo Theme</a>",
"Designed with <span class=\"red\">♥</span> by <a href=\"https://www.mattlangford.com\">Matt Langford</a>": "Disegnato col <span class=\"red\">♥</span> da <a href=\"https://www.mattlangford.com\">Matt Langford</a>"
}
layouts/_default/list.archivehtml.html:
<h2 class="p-name post-title">{{ T "Archive" }}</h2>
[...]
<div class="full-archives h-feed">
<h3>{{ T "Full Post List" }}</h3>
{{ $list := (where .Site.Pages "Type" "post") }}
{{ range $list }}
[...]
</div>
The translations work perfectly on my local computer using Hugo 0.91 but not on micro.blog.
Specifically, the partials/footer.html
file translates correctly, but the translations in the layout/_default/list.archivehtml.html
layout don’t work.
I’ve experienced the same issue with both Hugo 0.91 and Hugo 0.117.