/** * Core i18n factory function. * @module bquery/i18n */ import type { I18nConfig, I18nInstance } from './types'; /** * Creates a reactive internationalization instance. * * The returned object provides: * - `$locale` — a reactive signal for the current locale * - `t()` — translation with interpolation and pluralization * - `tc()` — reactive translation that auto-updates on locale change * - `loadLocale()` — register lazy-loaded locale files * - `n()` — locale-aware number formatting * - `d()` — locale-aware date formatting * * @param config - Initial configuration * @returns An i18n instance * * @example * ```ts * import { createI18n } from '@bquery/bquery/i18n'; * * const i18n = createI18n({ * locale: 'en', * fallbackLocale: 'en', * messages: { * en: { * greeting: 'Hello, {name}!', * items: '{count} item | {count} items', * }, * de: { * greeting: 'Hallo, {name}!', * items: '{count} Gegenstand | {count} Gegenstände', * }, * }, * }); * * i18n.t('greeting', { name: 'Ada' }); // 'Hello, Ada!' * i18n.t('items', { count: 3 }); // '3 items' * * // Switch locale reactively * i18n.$locale.value = 'de'; * i18n.t('greeting', { name: 'Ada' }); // 'Hallo, Ada!' * ``` */ export declare const createI18n: (config: I18nConfig) => I18nInstance; //# sourceMappingURL=i18n.d.ts.map