Error: failed to load translations


⇒ My git

⇒ My hugo version:

$ hugo version
hugo v0.122.0+extended linux/amd64 BuildDate=2024-02-04T14:35:47Z VendorInfo=debian:0.122.0-1

Recently, I converted all files .toml to .yaml, to use /config/ directory, to simplify my process to translate menu, and i18n translations.

I’ve problem with my i18n/files translations, on i18n folder;

- id: alert-danger
  translation: Danger

hugo server fails to start with this error message:
Error: "~/doc.huc/i18n/en.yaml:1:1": failed to load translations: unsupported file format bool

  • If I use:
  other: Danger

hugo server fails to start again, with this other error message:
Error: "~/doc.huc/i18n/en.yaml:1:1": failed to load translations: yaml: line 2: did not find expected key or complain about true value (expected key to be string but got true)

Everything was working properly correctly, before converting my i18n .toml to i18n .yaml.
Egual, no problem with all config files .yaml

Any idea/suggestion?

For the record, I hate YAML.

The problem child is this:

- id: on
  translation: " on "

Change it to this:

- id: "on"
  translation: " on "

We’re still interpreting YAML per v1.1 of the YAML spec, where an unquoted on is a boolean true, as is the word yes. The unquoted words off and no are also booleans.

Really? Just for that! Huhhhh…

@jmooring: Thanks

1 Like

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