Language Switch β
js
import { XerLanguageSwitch } from "@xerius/codey-components";
PrimeVue Localization β
The Language Switch component automatically handles PrimeVue localization based on the selected language. See the PrimeVue documentation for more information.
When switching languages:
For nl-be, it sets the Dutch PrimeVue locale For fr-be, it sets the French PrimeVue locale
The default PrimeVue locale is set when initializing the @xerius/codey-components
plugin in your application. See the installation guide for more information.
Showcases β
Default β
With custom menuClass
β
This is useful to add extra margin to the rendered location of the language menu depending where the language switch is placed e.g. Header or Footer.
Props β
Name | Type | Default | Required | Description |
---|---|---|---|---|
languages | LanguageOption[] | true | The selectable languages | |
currentLanguageCode | string | true | the current language | |
menuClass | string | false | Custom classes to be set on the Menu component |
Events β
Name | Parameters | Description |
---|---|---|
update:currentLanguageCode | languageCode: string | The newly selected language code |