Open andrehrferreira opened 2 years ago
I couldn't use SwitchLocalePath too. How to do switch locale ? Could you tell us example on Nuxt3 please
I’m forcusing on nuxt/i18n. And currently, I’m developing core library for nuxt/i18n and it will be able to use as vue plugin library.
I wrote below code instead SwitchLocalePath
<script setup lang="ts">
import {useI18n} from "vue-i18n"
const i18n = useI18n()
const changeLocale = (locale: string) => {
i18n.locale.value = locale
}
</script>
<template>
<div class="lang-set">
<ul>
<li v-if="i18n.locale.value === 'ja'">
<button class="lang-set-button__english" @click="changeLocale('en')">English</button>
</li>
<li v-else>
<button class="lang-set-button__english" @click="changeLocale('ja')">日本語</button>
</li>
</ul>
</div>
</template>
is it possible to use the switchLocalePath function?