@shelchin/svelte-i18n
Version:
The last Svelte i18n library you'll ever need. Type-safe, AI-powered, zero-config.
20 lines (19 loc) • 649 B
TypeScript
/**
* Browser detection utilities
* Centralizes all browser language detection logic
*/
/**
* Detect the browser's preferred language
* @returns The detected language code or null if not available
*/
export declare function detectBrowserLanguage(): string | null;
/**
* Get the browser's preferred language, matching against available locales
* @param availableLocales - List of supported locales
* @returns The matched locale or null if no match found
*/
export declare function getBrowserLocale(availableLocales?: string[]): string | null;
/**
* Check if we're in a browser environment
*/
export declare function isBrowser(): boolean;