kun-galgame-vue/src/language/i18n.ts

22 lines
422 B
TypeScript
Raw Normal View History

2023-11-07 14:28:42 +00:00
import { createI18n } from 'vue-i18n'
// 读取本地存储中的语言配置
2023-08-20 13:38:40 +00:00
import { KUNGalgameLanguage } from '@/utils/getDefaultEnv'
2023-06-08 15:19:32 +00:00
2023-11-07 14:28:42 +00:00
// 引入语言文件
2023-05-19 18:23:25 +00:00
import zh from './zh'
import en from './en'
2023-11-07 14:28:42 +00:00
const i18n = createI18n({
locale: KUNGalgameLanguage,
// 支持 Vue3 composition API
legacy: false,
// 全局注册 t 方法
globalInjection: true,
messages: {
zh,
en,
},
})
2023-05-19 18:23:25 +00:00
2023-11-07 14:28:42 +00:00
export default i18n