---
title: Language Switcher
lastModified: "2026-10-07T18:56:41+01:00"
lastAuthor: Kaylee
---
```vue title="app/components/LanguageSwitcher.vue"
<script setup lang="ts">
const language = useConsentLanguage();
const kernel = useConsentKernel();

// Resolving again with `init()` loads the banner and dialog text in the
// new language.
const switchTo = (code: string) => {
	language.value = code;
	void kernel.commands.init();
};
</script>

<template>
	<button type="button" @click="switchTo('en')">English</button>
	<button type="button" @click="switchTo('de')">Deutsch</button>
</template>
```
