Skip to main content
Version: 5.x.x

Switching language

For language management, the Tolgee integration provides the useTolgee composable function. Use this function with subscription to the language event. Below is an example of how to use it for switching languages.

<template>
<select :value="tolgee.getLanguage()" v-on:change="changeLanguage">
...
</select>
</template>

<script setup>
import { useTolgee } from '@tolgee/vue';

const tolgee = useTolgee(['language']);

const changeLanguage = (e) => {
tolgee.value.changeLanguage(e.target.value);
};
</script>

Read more about Language change, detection and storage