/** * Velo Plot - Internationalization (i18n) Module * * Provides locale-aware formatting for numbers, dates, and chart UI. * Supports custom format functions and predefined locales. * * @module locale */ export interface LocaleConfig { /** Locale identifier (e.g., 'en-US', 'es-ES', 'de-DE') */ locale: string; /** Decimal separator override (auto-detected if not specified) */ decimalSeparator?: string; /** Thousands separator override (auto-detected if not specified) */ thousandsSeparator?: string; /** Date format pattern (e.g., 'DD/MM/YYYY', 'MM/DD/YYYY', 'YYYY-MM-DD') */ dateFormat?: string; /** Time format pattern (e.g., 'HH:mm:ss', 'hh:mm:ss a') */ timeFormat?: string; /** Custom number formatter */ numberFormatter?: (value: number, decimals?: number) => string; /** Custom date formatter */ dateFormatter?: (date: Date) => string; /** Short form labels (used in axis labels) */ shortLabels?: { time?: string; value?: string; points?: string; }; /** Full form labels (used in tooltips/panels) */ labels?: { start?: string; pause?: string; reset?: string; export?: string; autoScale?: string; pan?: string; zoom?: string; select?: string; legend?: string; fps?: string; points?: string; loading?: string; noData?: string; error?: string; }; } export interface LocaleFormatter { /** Format a number with the locale settings */ formatNumber(value: number, decimals?: number): string; /** Format a date with the locale settings */ formatDate(date: Date): string; /** Format a time with the locale settings */ formatTime(date: Date): string; /** Format a date and time with the locale settings */ formatDateTime(date: Date): string; /** Format a number with SI prefix (k, M, G, etc.) */ formatWithPrefix(value: number, unit?: string): string; /** Format a number in scientific notation */ formatScientific(value: number, decimals?: number): string; /** Get a localized label */ getLabel(key: keyof NonNullable): string; } export declare const LOCALE_EN_US: LocaleConfig; export declare const LOCALE_ES_ES: LocaleConfig; export declare const LOCALE_DE_DE: LocaleConfig; export declare const LOCALE_FR_FR: LocaleConfig; export declare const LOCALE_PT_BR: LocaleConfig; export declare const LOCALE_ZH_CN: LocaleConfig; export declare const LOCALE_JA_JP: LocaleConfig; /** * Set the global locale for all charts */ export declare function setGlobalLocale(localeOrConfig: string | LocaleConfig): void; /** * Get the current global locale */ export declare function getGlobalLocale(): LocaleConfig; /** * Get a predefined locale by name */ export declare function getLocale(name: string): LocaleConfig | undefined; /** * Register a custom locale */ export declare function registerLocale(name: string, config: LocaleConfig): void; /** * Create a locale formatter from a configuration */ export declare function createLocaleFormatter(config?: LocaleConfig | string): LocaleFormatter; export declare const defaultFormatter: LocaleFormatter;