feat: i18n support
This commit is contained in:
17
components/LangSwitcher.vue
Normal file
17
components/LangSwitcher.vue
Normal file
@ -0,0 +1,17 @@
|
||||
<script setup lang="ts">
|
||||
const { locale, availableLocales, t, setLocale } = useI18n()
|
||||
|
||||
const localeOptions = availableLocales.map((locale) => ({
|
||||
value: locale,
|
||||
label: t('language', {}, { locale }),
|
||||
}))
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<USelect
|
||||
icon="i-lucide-languages"
|
||||
:model-value="locale"
|
||||
:items="localeOptions"
|
||||
@update:model-value="setLocale($event)"
|
||||
/>
|
||||
</template>
|
Reference in New Issue
Block a user