Returns a label with replaced variables
const theLang = {
my: { nested: {
key: '{0}, I like bacon. {1}, I like eggs.'
key2: '{first}, I like steak. {second}, I like rice.'
}}
}
t('my.nested.key', ['Yes', 'No']);
// > 'Yes, I like bacon. No, I like eggs.'
t('my.nested.key2', { first: 'Ofcourse', second: 'Obviously' });
// > 'Ofcourse, I like steak. Obviously, I like rice.'
Optionallistener: LocaleListener<Code>Optionalvalues: LocaleManager.LocaleFormatArgs
Type-safe locale manager with async loading, namespace scoping, ICU-lite pluralization, and Intl formatting.
WHY: Centralizes all i18n concerns — translation lookup, locale switching, lazy-loaded locales, and number/date formatting — behind a single event-driven API.
Example