Skip to main content

to_language

Turn a locale name (en_US) into a language name (en-us).

def to_language(
locale: string
) - > string

Turn a locale name (en_US) into a language name (en-us).

Parameters

NameTypeDescription
localestringThe locale string containing an underscore separator to be converted into a language tag format

Returns

TypeDescription
stringThe normalized language identifier with lowercase characters and hyphen separators