Files
yinnihailiang_one/lms/nladmin-ui/src/i18n/index.js
2026-01-04 17:08:17 +08:00

20 lines
701 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import Vue from 'vue'
import VueI18n from 'vue-i18n'
// 国际化开发5。i18n index文件修改
Vue.use(VueI18n)
// 准备默认的语言环境消息(可以是空对象,也可以是一些基本消息)
const defaultLocale = 'zh'
const fallbackLocale = 'zh'
// 创建i18n实例
const i18n = new VueI18n({
locale: defaultLocale, // 设置当前语言
fallbackLocale, // 设置回退语言
silentTranslationWarn: true, // 解决vue-i18n黄色警告"value of key 'xxx' is not a string"和"cannot translate the value of keypath 'xxx'.use the value of keypath as default",可忽略
globalInjection: true,
messages: {} // 初始化为空,稍后从接口获取
})
export default i18n