Generated API reference for @rekhly/i18n →
@rekhly/i18nLocalization for Rekhly Visuals chart chrome, tooltips, and accessibility labels. Ships complete tables for English, Spanish, German, French, Chinese, and Japanese. Host apps can override any key.
import {
configureI18n,
createTranslator,
formatNumber,
negotiateLocale,
t,
} from "@rekhly/i18n";
// Optional: pick a default locale + custom overrides when the app boots.
configureI18n({
locale: negotiateLocale(navigator.languages),
messages: {
// Only the keys you provide are overridden; the rest stay built-in.
es: { zoomIn: "Ampliar (marca propia)" },
en: { resetZoom: "Fit all" },
},
});
t("zoomIn"); // uses the configured default locale
formatNumber("de", 1234.5); // "1.234,5"
import { createTranslator } from "@rekhly/i18n";
import { rekhly } from "@rekhly/core";
const chart = rekhly.chartXY({
container,
locale: "ja",
translations: { resetZoom: "全体表示" },
});
locale and translations on chart options feed a bound translator used by toolbar buttons, restore/box-zoom tooltips, and screen-reader labels.
| Export | Role |
|---|---|
configureI18n / registerMessages / addTranslations |
App-level catalog overrides |
setLocale / getLocale / onI18nChange |
Process-wide default locale |
t / tWith / createTranslator |
Lookup + interpolation |
describeChart |
Localized a11y summary |
formatNumber / formatDate |
Intl helpers |
negotiateLocale |
Browser / Accept-Language → Locale |
messages / SUPPORTED_LOCALES |
Built-in tables |
Got any questions? I'm happy to help with products, licensing, and examples.