/** * Minimal, dependency-free translation layer for the Svelte binding. * * The canonical English dictionary lives in `pptx-viewer-shared/i18n` (shared * with the React, Vue, and Angular bindings, which each plug it into their * framework's i18n library). Svelte has no blessed i18n runtime, so this * module implements the small subset the viewer needs: dictionary lookup by * locale with English fallback, `{{name}}` interpolation, and the shared * `keyToLabel` humanised fallback for missing keys. */ /** A flat dictionary of dotted `pptx.*` keys to display strings. */ export type TranslationDictionary = Record; /** Translate `key`, interpolating `{{name}}` placeholders from `params`. */ export type Translator = (key: string, params?: Record) => string; /** * Register (or extend) the dictionary for a locale. Later registrations are * merged over earlier ones, so hosts can override individual keys. */ export declare function registerTranslations(locale: string, dictionary: TranslationDictionary): void; /** * List every locale code with a registered dictionary: `en` (built in) plus * anything added via {@link registerTranslations}. Used by File > Options' * Language tab to offer only locales the host has actually wired up. */ export declare function getRegisteredLocales(): string[]; /** Interpolate `{{name}}` placeholders (the shared-dictionary convention). */ export declare function interpolate(message: string, params: Record | undefined): string; /** * Translate a key for a locale: exact locale dictionary, then its base * language (`fr-CA` falls back to `fr`), then English, then the humanised * `keyToLabel` fallback so missing keys never render as raw dotted paths. */ export declare function translate(locale: string, key: string, params?: Record): string; /** Build a {@link Translator} bound to a (lazily-read) locale. */ export declare function createTranslator(getLocale: () => string): Translator; //# sourceMappingURL=translator.d.ts.map