I18n: is YAML still supported?

I’ve got a translations yaml file, i18n/de.yaml:

- id: category
  translation:
    one: foo
    other: bar

For some reason, when I call http://localhost:1313/de/, I see the keys instead of translations. I’ve followed a tutorial at https://regisphilibert.com/blog/2018/08/hugo-multilingual-part-2-i18n-string-localization

The Hugo documentation at content-management/multilingual/ doesn’t mention YAML, and I wonder if it done on purpose.

Is YAML still supported for i18n or not?

When I switch to to toml, the translations are displayed for all but the default language, see I18n keys instead of translations in default language

$ hugo version
    Hugo Static Site Generator v0.69.0-4205844B/extended darwin/amd64 BuildDate: 2020-04-10T09:15:13Z

Here are relevant parts of my setup:

In single.html:

<a href="/categories">
     {{ i18n "category" }}
</a>

$ cat config/_default/languages.yaml 
    en:
        languageName: English
        weight: 0
    ru:
        languageName: Русский
        weight: 20
    de:
        languageName: Deutsch
        weight: 30
    es:
        languageName: Español
        weight: 40

It is. See example here:

Thank you @martignoni. That’s surprising. But how should the plurals be handled, then?

Here is your answer:

- id: tag
  translation:
    one: "Étiquette"
    other: "Étiquettes"
1 Like

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