Skip to content

i18n: Silent failure when using ISO 639-3 language tags that have ISO 639-1 equivalents #9260

Open
@jmooring

Description

@jmooring

Reference: https://discourse.gohugo.io/t/35938

This behavior was introduced with v0.76.0 where we upgraded nicksnyder/go-i18n from v1 to v2.

Language Tag Description i18n
eng ISO 639-3
nld ISO 639-3
es ISO 639-1 ✔️
zzz artificial ✔️
mylang artificial ✔️

MRE

git clone --single-branch -b hugo-forum-topic-35938 https://github.com/jmooring/hugo-testing hugo-forum-topic-35938
cd hugo-forum-topic-35938
hugo server

Notes

  1. I suspect this is a limitation of nicksnyder/go-i18n, but do not know for certain. For example, the CLDR data has entries for en and nl, but not for eng and nld.
  2. Using ISO 639-3 also prevents localization of dates, currency, numbers, and percentages. That is a related but separate issue, Use Language.LanguageCode as localization key, falling back to language.Lang #9109.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions