Skip to content

LocalizationAPI

Defined in: i18n/Localization.ts:57

Per-App localization service: catalogs keyed by locale, an active locale + a fallback, and t() resolution (active → fallback → the key itself). Published as the Localization resource; read it as app.getResource(Localization).

new LocalizationAPI(locale?, fallback?): LocalizationAPI

Defined in: i18n/Localization.ts:63

string = 'en'

string = 'en'

LocalizationAPI

get fallbackLocale(): string

Defined in: i18n/Localization.ts:79

string


get locale(): string

Defined in: i18n/Localization.ts:76

string

addCatalog(locale, entries): void

Defined in: i18n/Localization.ts:69

Merge entries into a locale’s catalog (later calls override keys).

string

LocaleCatalog

void


availableLocales(): string[]

Defined in: i18n/Localization.ts:87

Locales that have a catalog, in insertion order.

string[]


has(key): boolean

Defined in: i18n/Localization.ts:92

True if the key resolves in the active locale or the fallback.

string

boolean


setFallbackLocale(locale): void

Defined in: i18n/Localization.ts:78

string

void


setLocale(locale): void

Defined in: i18n/Localization.ts:75

string

void


setPluralSelector(locale, selector): void

Defined in: i18n/Localization.ts:82

Override the plural rule for a locale (e.g. languages with few/many).

string

PluralSelector

void


t(key, params?): string

Defined in: i18n/Localization.ts:101

Translate key, interpolating {params}. A pluralized entry selects a form from params.count (default 0). Unknown keys return the key itself (a visible, greppable fallback) rather than throwing.

string

TParams

string