locale-info
¶
Gets information about ICU4X' understanding of the locale
.
Arguments¶
locale
¶
The Unicode Locale Identifier to parse.
Structure¶
A Unicode Locale Identifier starts with a Unicode Language Identifier and is optionally followed by extensions. Most of the time the language identifier is sufficient to get the desired output.
The language identifier starts with a language subtag with an optional script subtag or just a script subtag. Afterwards, the region subtag and variant subtag can be specified.
In this library, only some of the Unicode extensions (-u-
extensions) are important.
ca
can be used to specify the calendar for dates and datetimes (calendar.xml)hc
can be used to specify the hour cycle for time formatters (reference)
Example¶
The locale zh-Hans-CN
specifies the language subtag as zn
(Chinese), the script subtag as Hans
(simplified Han), and the region subtag as CN
(China).
You can test your identifiers on util.unicode.org/UnicodeJsps/languageid.jsp.
Examples¶
Language Identifier¶
Chinese, tranditional Han, Hong Kong
Default Language¶
The default "undefined" language.
Full Unicode Locale Identifier¶
A Unicode Locale Identifier specifying all extensions.
#let language-id = "en-arab-DE-posix-macos"
#let unicode-ext = "-u-foo-bar-hc-h12-ca-buddhist"
#let transform-ext = "-t-en-latn-US-windows-rusty-h0-hybrid"
#let private-ext = "-a-other-ext"
#let other-ext = "-x-typst-wasm"
#locale-info(
language-id +
unicode-ext +
transform-ext +
private-ext +
other-ext
)