P粉1436404962023-08-27 00:25:26
I found the solution. Just import your i18n
into a file outside your application and use i18n.global.t
import { createI18n } from "vue-i18n" export const i18n = createI18n({ legacy: false, locale: 'ja', fallbackLocale: 'en', messages, })
import { i18n } from '@/i18n' const { t: $t, d: $d, n: $n } = i18n.global const expample = $t('some-text')