Skip to content

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 ​

NameTypeDefaultRequiredDescription
languagesLanguageOption[]trueThe selectable languages
currentLanguageCodestringtruethe current language
menuClassstringfalseCustom classes to be set on the Menu component

Events ​

NameParametersDescription
update:currentLanguageCodelanguageCode: stringThe newly selected language code