Skip to main content
Version: 1.1.2

Bundle

Exposes properties on the loaded resource bundle. The bundle is the collection of strings and other properties for a given locale.

id

Identifier of the bundle's Locale. This is the expanded language tag identifying the bundle.

Syntax

id(): string

Example

const cldr = framework.get('fr-CA');
const bundle = cldr.General.bundle();
log(bundle.id());
fr-Latn-CA

language

The IETF code for this bundle's language.

Syntax

language(): string

Example

const cldr = framework.get('no');
const bundle = cldr.General.bundle();
log(bundle.language());
nb

plurals

The set of PluralRules used for this locale.

Syntax

plurals(): PluralRules

Example

const cldr = framework.get('en');
const plurals = cldr.General.bundle().plurals();
for (const n of [0, 1, '1.0']) {
log(n, plurals.cardinal(n));
}
0 other
1 one
1.0 other

region

The IETF for this bundle's region.

Syntax

region(): string

Example

const cldr = framework.get('pt');
const bundle = cldr.General.bundle();
log(bundle.region());
BR