You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What version of Hugo are you using (hugo version)?
$ hugo version
hugo v0.119.0+extended linux/amd64 BuildDate=unknown
Does this issue reproduce with the latest release?
Reproduced with hugo v0.120.4-f11bca5fec2ebb3a02727fb2a5cfb08da96fd9df linux/amd64 BuildDate=2023-11-08T11:18:07Z VendorInfo=gohugoio
The problem
In the i18n file for the language, creating this key named something.description: will disable the translation :
something:
description: "A description"
It looks like the key description is reserved or something. I just hope I haven't missed it in the documentation and I apologize if it's the case.
Setup
Multilingual site fr + en
fr is the default language
Two i18n files made : fr.yaml, en.yaml
Reproduced on a fresh hugo site
Details
hugo new site test
Congratulations! Your new Hugo site was created in /home/seb/kDrive/Documents/blog/test.
Just a few more steps...
1. Change the current directory to ...../test.
2. Create or install a theme:
- Create a new theme with the command "hugo new theme <THEMENAME>"
- Install a theme from https://themes.gohugo.io/
3. Edit hugo.toml, setting the "theme" property to the theme name.
4. Create new content with the command "hugo new content <SECTIONNAME>/<FILENAME>.<FORMAT>".
5. Start the embedded web server with the command "hugo server --buildDrafts".
hugo new theme test
Creating new theme in ........../test/themes/test
We use the nicksnyder/go-i18n package to handle translations. There are several reserved words in the translation data structure:
id
: Uniquely identifies the message.
description
: Describes the message to give additional context to translators that may be relevant for translation.
hash
: Uniquely identifies the content of the message that this message was translated from.
leftdelim
: The left Go template delimiter.
rightdelim
: The right Go template delimiter.
zero
: The content of the message for the CLDR plural form "zero".
one
: The content of the message for the CLDR plural form "one".
two
: The content of the message for the CLDR plural form "two".
few
: The content of the message for the CLDR plural form "few".
many
: The content of the message for the CLDR plural form "many".
other
: The content of the message for the CLDR plural form "other".
I've created an issue in the documentation repository to list these somewhere: gohugoio/hugoDocs#2311
What version of Hugo are you using (
hugo version
)?Does this issue reproduce with the latest release?
Reproduced with
hugo v0.120.4-f11bca5fec2ebb3a02727fb2a5cfb08da96fd9df linux/amd64 BuildDate=2023-11-08T11:18:07Z VendorInfo=gohugoio
The problem
In the i18n file for the language, creating this key named
something.description:
will disable the translation :It looks like the key
description
is reserved or something. I just hope I haven't missed it in the documentation and I apologize if it's the case.Setup
fr.yaml
,en.yaml
Reproduced on a fresh hugo site
Details
Directory structure :
Details
Hugo config
Details
Translation files
fr.yaml
en.yaml
Steps to reproduce
In
themes/<theme>/layouts/defaults/single.html
I've added these i18n calls and the lang display.Screenshots
👍
If I enable
description:
in the English language file, the translation revers to default lang => French in my case.Screenshots
The English translation is disabled.
If I enable
description:
in the French file, both English and French i18n lines are lost :Screenshots
hugo --printI18nWarnings
returns missing translations :hugo print i18n warnings
Please note that the other YAML parts are not impacted.
Screenshot
Thanks for your help !
The text was updated successfully, but these errors were encountered: