UNPKG

@shelchin/svelte-i18n

Version:

The last Svelte i18n library you'll ever need. Type-safe, AI-powered, zero-config.

30 lines (29 loc) 1.05 kB
/** * Universal load function for i18n (+layout.ts) * Handles both server and client-side initialization */ import type { I18nInstance } from '../core/types.js'; /** * Universal load function for i18n * Use this in your +layout.ts file * * @param i18n - The i18n instance * @param data - Data from parent layout (server data) * @param url - Optional URL for pathname detection * @param options - Configuration options */ export declare function loadI18nUniversal<T = I18nInstance>(i18n: T & Pick<I18nInstance, 'locale' | 'locales' | 'setLocale'>, data: any, url?: URL | { pathname: string; }, options?: { storageKey?: string; defaultLocale?: string; namespace?: string; }): Promise<any>; /** * Backward compatible universal load function * @deprecated Use loadI18nUniversal instead */ export declare function i18nUniversalLoad<T = I18nInstance>(i18n: T & Pick<I18nInstance, 'locale' | 'locales' | 'setLocale'>, data: any, browser: boolean, options?: { storageKey?: string; defaultLocale?: string; }): Promise<any>;