Skip to main content

Module locale

Module locale 

Source
Expand description

Round 1 (docs/round-1-contract.md §4): the locale decisions every renderer shares (catalog/locale.json, embedded): the week start by region, the likely region of a bare language, the right-to-left languages. Formatting itself is the platform’s ICU; these are the parts that must not differ. Mirrors src/locale.ts.

Constants§

DEFAULT_LOCALE

Functions§

parse_locale
pt-BR → (pt, BR); zh-Hant-TW → (zh, TW); de → (de, None). The region = the first 2-letter or 3-digit subtag after the language.
text_direction
rtl for the right-to-left languages, else ltr.
week_start
The first day of the week, 0 = Sunday … 6 = Saturday.