You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
453 B
26 lines
453 B
|
1 year ago
|
import { createI18n } from 'vue-i18n';
|
||
|
|
import { useAppStore } from '@/store/modules/app';
|
||
|
|
|
||
|
|
const appStore = useAppStore();
|
||
|
|
// 本地语言包
|
||
|
|
import enLocale from './package/en';
|
||
|
|
import zhCnLocale from './package/zh-cn';
|
||
|
|
|
||
|
|
const messages = {
|
||
|
|
'zh-cn': {
|
||
|
|
...zhCnLocale
|
||
|
|
},
|
||
|
|
en: {
|
||
|
|
...enLocale
|
||
|
|
}
|
||
|
|
};
|
||
|
|
|
||
|
|
const i18n = createI18n({
|
||
|
|
legacy: false,
|
||
|
|
locale: appStore.language,
|
||
|
|
messages: messages,
|
||
|
|
globalInjection: true
|
||
|
|
});
|
||
|
|
|
||
|
|
export default i18n;
|