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.18 kB
/** * Utility functions for translation management * These functions help organize and access translations */ import type { TranslationRegistry } from '../services/built-in-loader.js'; /** * Get all available locales from a translation registry */ export declare function getAvailableLocales(registry: TranslationRegistry): string[]; /** * Get translation for a specific namespace and locale */ export declare function getTranslation(registry: TranslationRegistry, namespace: string, locale: string): Record<string, unknown> | undefined; /** * Merge all translations for a specific locale across namespaces */ export declare function getMergedTranslations(registry: TranslationRegistry, locale: string): Record<string, unknown>; /** * Check if a locale is available in the registry */ export declare function isLocaleAvailable(registry: TranslationRegistry, locale: string): boolean; /** * Get all namespaces in the registry */ export declare function getNamespaces(registry: TranslationRegistry): string[]; /** * Get all locales for a specific namespace */ export declare function getNamespaceLocales(registry: TranslationRegistry, namespace: string): string[];