| | |
| | | // i18n.js 或类似的配置文件 |
| | | import { createI18n } from 'vue-i18n' |
| | | import en from './locales/en.json' // 英文语言包 |
| | | import zh from './locales/zh.json' // 中文语言包 |
| | | |
| | | import {zh as planZh, en as planEn} from './locales/plan' |
| | | import {zh as commonZh, en as commonEn} from './locales/common' |
| | | // import {zh as testZh, en as testEn} from './test' |
| | | let EN = { |
| | | plan: planEn, |
| | | common: commonEn |
| | | } |
| | | let ZH = { |
| | | plan: planZh, |
| | | common: commonZh |
| | | } |
| | | const i18n = createI18n({ |
| | | locale: 'zh', // 设置默认语言为中文 |
| | | fallbackLocale: 'ch', |
| | | fallbackLocale: 'zh', |
| | | globalInjection:true, |
| | | legacy: false, // you must specify 'legacy: false' option |
| | | messages: { |
| | | en, |
| | | zh, |
| | | en: EN, |
| | | zh: ZH |
| | | }, |
| | | }) |
| | | |
| | | export default i18n |