docs_vue2/plugins/i18n.js

17 lines
287 B
JavaScript
Raw Normal View History

2020-08-13 11:47:56 +08:00
import Vue from 'vue'
import VueI18n from 'vue-i18n'
2022-06-14 09:05:00 +08:00
import {
getLocale
} from '../common/i18n'
2020-08-13 11:47:56 +08:00
import i18nMgr from 'veui/managers/i18n'
Vue.use(VueI18n)
2022-06-14 09:05:00 +08:00
export default ({
app,
route
}) => {
2020-08-13 11:47:56 +08:00
app.i18n = new VueI18n()
2022-05-05 15:52:28 +08:00
i18nMgr.locale = app.i18n.locale = getLocale(route.path)
2020-08-13 11:47:56 +08:00
}