Auth0 Universal Components
    Preparing search index...

    Interface I18nServiceInterface

    Main interface for the i18n service providing translation management capabilities. Framework-agnostic core functionality.

    interface I18nServiceInterface {
        commonTranslator: EnhancedTranslationFunction;
        currentLanguage: string;
        fallbackLanguage: string | undefined;
        translator: TFactory;
        changeLanguage(
            language: string,
            newFallbackLanguage?: string,
        ): Promise<void>;
        getCurrentTranslations(): LangTranslations | null;
    }
    Index

    Properties

    commonTranslator: EnhancedTranslationFunction

    Pre-configured translator for common translations

    currentLanguage: string

    Current active language code

    fallbackLanguage: string | undefined

    Fallback language code

    translator: TFactory

    Factory for creating namespace-scoped translation functions

    Methods

    • Changes the active language and reloads translations.

      Parameters

      • language: string

        The new language code to switch to

      • OptionalnewFallbackLanguage: string

        Optional new fallback language

      Returns Promise<void>