Skip to main content

formatLocale

The locale tag to give Intl for numbers and dates: the catalogue's language, with its numberingSystem as a -u-nu- extension when it has one; a malformed system is ignored. Calendars are not touched, so a language keeps its own (Thai years are Buddhist, Persian years are Solar Hijri). Plural selection, lists and the lang attribute use the plain language.

This is a function exported by @mapcairn/core, checked against version 0.2.0.

Signature​

import { formatLocale } from "@mapcairn/core";

function formatLocale(catalogue: Pick<MessageCatalogue, "language" | "numberingSystem">): string;

Parameters​

  • catalogue (Pick<MessageCatalogue, "language" | "numberingSystem">)

Returns​

string

See also​

Source: packages/core/src/format/format.ts:131