Deepen-merge overrides for a single locale.
(locale: Locale, table: PartialMessages) => voidClear all custom overrides (tests / hot reload). Built-ins are unchanged.
() => voidMerge app-level configuration into the global catalog.
(config: I18nConfig) => voidCreate a translator, optionally seeded with a locale and/or overrides.
(options?: { readonly locale?: Locale; readonly messages?: PartialMessages; }) => TranslatorPer-locale partial overrides supplied by the host app.
type CustomLocaleMessages = Partial<Record<Locale, Partial<MessageTable>>>Localized chart description for screen readers (includes keyboard help).
(locale: Locale, title: string, seriesCount: number, sampleCount: number) => stringFormats a date/time using the locale's `Intl.DateTimeFormat` conventions.
(locale: Locale, value: number | Date, options?: Intl.DateTimeFormatOptions) => stringFormats a number using the locale's `Intl.NumberFormat` conventions.
(locale: Locale, value: number, options?: Intl.NumberFormatOptions) => stringCurrent process-wide default locale.
() => LocaleConfigure the process-wide i18n defaults used by chart chrome when a chart does not pass its own `locale` / `translations`. Call once at app startup — overrides merge on top of the built-in tables and later calls deepen-merge rather than replace the whole catalog.
interface I18nConfig| locale? | Locale | undefined |
| messages? | Partial<Record<Locale, Partial<MessageTable>>> | undefined |
| fallback? | Locale | undefined |
Interpolate `{name}` placeholders in a message template.
(template: string, vars?: MessageVars) => stringRecord<Locale, string>True for locales that read right-to-left.
(_locale: Locale) => booleanBuilt-in UI / tooltip / a11y messages for every supported locale. Keys are stable public identifiers — apps override by key, not by English text.
type Locale = Localetype LocaleMessages = LocaleMessagesStable message keys used by chart chrome, tooltips, and a11y labels.
type MessageKey = MessageKeyLocaleMessagestype MessageTable = MessageTabletype MessageVars = Readonly<Record<string, string | number>>Resolves a browser `navigator.languages` list or a Next.js `Accept-Language` header value down to the best supported {@link Locale}, falling back to `"en"`. Base-language matches (`"de-AT"` → `"de"`) count.
(preferred: readonly string[] | string, supported?: readonly Locale[]) => LocaleSubscribe to global locale / catalog changes. Returns an unsubscribe.
(listener: (locale: Locale) => void) => () => voidtype PartialMessages = Partial<MessageTable>Deepen-merge overrides for many locales at once (typical package import path).
(table: CustomLocaleMessages) => voidSet the process-wide default locale. Charts that already hold an explicit locale are unchanged; call their `setLocale` (when available) to update them.
(locale: Locale) => voidreadonly Locale[]Translate a built-in message key. Resolution order: locale overrides → locale built-in → fallback overrides → fallback built-in → English → the key itself.
(key: MessageKey, vars?: MessageVars, locale?: Locale) => stringA bound translator for one chart / component tree. Owns its own locale and optional local overrides; still falls through to the global catalog.
interface Translator| locale | Locale |
| messages | Partial<MessageTable> |
| t | (key: MessageKey, vars?: MessageVars) => string |
| setLocale | (locale: Locale) => void |
| addTranslations | (table: PartialMessages) => void |
| table | () => MessageTable |
Look up with an optional per-call override table (chart-level custom strings).
(key: MessageKey, options?: { readonly locale?: Locale; readonly messages?: PartialMessages; readonly vars?: MessageVars; }) => stringGot any questions? I'm happy to help with products, licensing, and examples.