👏
vue-i18nとNuxt3
intlify/nuxt3
FOR NOW
DO NOT USE Cauz so many bugs...
vue-18n-next
install yarn add vue-i18n@9
make a plugin for nuxt3
Make a folder with path like /plugins/i18n.client.ts
.
Then edit it like this:
import { createI18n } from 'vue-i18n'
const messages = {
en: {
message: {
hello: 'hello world'
}
},
ja: {
message: {
hello: 'こんにちは、世界'
}
}
}
const i18n = createI18n({
locale: 'ja',
fallbackLocale: 'en',
messages,
})
export default defineNuxtPlugin((nuxtApp) => {
nuxtApp.vueApp.use(i18n)
})
- ALL DONE! *
Discussion