Use composition for translation
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
const { locale, locales } = useI18n();
|
||||
const { locale, locales, t } = useI18n();
|
||||
|
||||
const availableLocales = computed(() => {
|
||||
return locales.value.filter((i) => i.code !== locale.value);
|
||||
@@ -15,12 +15,12 @@ function l(locale: (typeof locales.value)[0]) {
|
||||
v-for="loc in availableLocales"
|
||||
:key="loc.code"
|
||||
:to="$switchLocalePath(loc.code)"
|
||||
:title="$t('layouts.switch_lang', { locale: $t(`locales.${l(loc)}`) })"
|
||||
:title="t('layouts.switch_lang', { locale: t(`locales.${l(loc)}`) })"
|
||||
>
|
||||
<VaSidebarItemContent>
|
||||
<VaIcon name="language" />
|
||||
<VaSidebarItemTitle>
|
||||
{{ $t('layouts.switch_lang', { locale: $t(`locales.${l(loc)}`) }) }}
|
||||
{{ t('layouts.switch_lang', { locale: t(`locales.${l(loc)}`) }) }}
|
||||
</VaSidebarItemTitle>
|
||||
</VaSidebarItemContent>
|
||||
</VaSidebarItem>
|
||||
|
||||
Reference in New Issue
Block a user