Interface LanguageSwitcherMethods

interface LanguageSwitcherMethods {
    configure: (config: Partial) => Promise<boolean>;
}

Properties

Properties

configure: (config: Partial) => Promise<boolean>

Configure language change behavior for each supported language.

Type declaration

    • (config: Partial): Promise<boolean>
    • Parameters

      • config: Partial

        A partial record mapping language codes to either a callback function (called when language changes) or a URL string (for navigation).

      Returns Promise<boolean>

      A promise that resolves to a boolean, confirming if the configuration was successfully applied.

// Using callbacks
const success = await globalHeaderClient.languageSwitcher.configure({
nl: (language) => console.log('Changed to Dutch'),
en: (language) => console.log('Changed to English')
});

// Using Link objects for navigation
const success = await globalHeaderClient.languageSwitcher.configure({
nl: { href: '/nl' },
en: { href: '/en' }
});