Best practices for i18n

Not sure if you’ve seen this @digitalcraftsman, but this helped me get my bilingual site sorted:

For small repeated strings I’m putting them in:

/data/translations/en-US.yaml
/data/translations/ja-JP.yaml

… setting “locale” in config_en.toml and config-ja.toml, and calling from my index template like:

{{ ( index $.Site.Data.translations $.Site.Params.locale ).somestring }}

… where “somestring” is:

somestring: ザ文字列

… in the yaml.

1 Like