Skip to content

Use Language.LanguageCode as localization key, falling back to language.Lang #9109

Open
@razonyang

Description

@razonyang

Hugo supports localize time and dates since v0.87.0, but I'm stuck by specifying the language key that not defined in https://github.com/gohugoio/locales.

For example:

[zh_hans] # localization works as expected.
  languageName = "zh_hans"

[zh-cn]
  languageName = "zh-cn"
  locale = "zh_hans" # additional parameter to match the locale

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions