Spaces:
Build error
Build error
File size: 731 Bytes
c742717 c744a44 c742717 c744a44 c742717 c744a44 c742717 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
import type { App } from 'vue'
import { createI18n } from 'vue-i18n'
import viVN from './vi-VN'
import enUS from './en-US'
import ruRU from './ru-RU'
import { useAppStoreWithOut } from '@/store/modules/app'
import type { Language } from '@/store/modules/app/helper'
const appStore = useAppStoreWithOut()
const defaultLocale = appStore.language || 'ru-RU'
const i18n = createI18n({
locale: defaultLocale,
fallbackLocale: 'vi-VN',
allowComposition: true,
messages: {
'vi-VN': viVN,
'en-US': enUS,
'ru-RU': ruRU,
},
})
export const t = i18n.global.t
export function setLocale(locale: Language) {
i18n.global.locale = locale
}
export function setupI18n(app: App) {
app.use(i18n)
}
export default i18n
|