Revert " vue add i18n"

This reverts commit 810407cde0 [formerly 06c2000def6d103aff231bd7a53a02d9ace87ca2] [formerly b12df0763e624fb55c9832ce4c7ec93ec881b19b] [formerly aef4bbe6556d4bc4b6eb561c28148dd8b4395cbf] [formerly 58b881a85f8baab6e6ef578575953de17bff0d40] [formerly 90771d09b3356812c438fa9cb8fa713c7fe86762] [formerly 4f1713142447f154592c4b74fb5e167df4287be1 [formerly 6daa81e0511c54daab83f96ff69c37b0cd55cc55]] [formerly eb82e859e47e2ec91f48023c705189e538b986e8] [formerly 2084d2f5552ba9ed91ce295cf7bc04e4d2a64e49] [formerly 93a57ab73023e37e7bd418f4221db12507653d74 [formerly 93a57ab73023e37e7bd418f4221db12507653d74 [formerly 93a57ab73023e37e7bd418f4221db12507653d74 [formerly 93a57ab73023e37e7bd418f4221db12507653d74 [formerly 331c42f3cf9c23bf114ea692b3aa23662d0963a5 [formerly a5f9f2449758fcc55395ccba72fb785b1764b593]]]]]].


Former-commit-id: cd1111a8660b1b8d3ce70abf0da421dd9e3c4585 [formerly cd1111a8660b1b8d3ce70abf0da421dd9e3c4585 [formerly cd1111a8660b1b8d3ce70abf0da421dd9e3c4585 [formerly cd1111a8660b1b8d3ce70abf0da421dd9e3c4585 [formerly e2bde741e1e71f84e69d9dd43b91e42cf1232624 [formerly 4981841af60ee395b89342a56583c14e0005f4ed]]]]]
Former-commit-id: baa090fe90d70c27cfd03ce1d2f608b59bdbc2a9
Former-commit-id: 392bae4192ceccc772d364b750f7ed1c7c9820a2
Former-commit-id: 9526616de130ea626e8a6cd37b8e76023c18c7bb [formerly bc53762a5f3db8f66a670cdba19760ca8ddbf944]
Former-commit-id: 587812dd74866fa0512ec7f791735f9ed8b3d508
Former-commit-id: a2fd8638fcbeda02b5d55a41d0fb1fd7859f5c31
Former-commit-id: b125c4c7d74f5a460bfb9b5613a3606f1b82bb47
Former-commit-id: ceb39f1a45afbc913f585073d43ec8addce8a7b6
Former-commit-id: a342aa6aab9e2af77edc228ab4a7317bd50a54d8
This commit is contained in:
liyang
2019-05-21 23:44:19 +08:00
parent 810407cde0
commit 9a7b11a9bb
7 changed files with 12 additions and 57 deletions

View File

@@ -1,23 +0,0 @@
import Vue from 'vue'
import VueI18n from 'vue-i18n'
Vue.use(VueI18n)
function loadLocaleMessages () {
const locales = require.context('./locales', true, /[A-Za-z0-9-_,\s]+\.json$/i)
const messages = {}
locales.keys().forEach(key => {
const matched = key.match(/([A-Za-z0-9-_]+)\./i)
if (matched && matched.length > 1) {
const locale = matched[1]
messages[locale] = locales(key)
}
})
return messages
}
export default new VueI18n({
locale: process.env.VUE_APP_I18N_LOCALE || 'en',
fallbackLocale: process.env.VUE_APP_I18N_FALLBACK_LOCALE || 'en',
messages: loadLocaleMessages()
})

View File

@@ -1,3 +0,0 @@
{
"message": "hello i18n !!"
}

View File

@@ -31,7 +31,6 @@ import d2VueFiltersDayjs from '@d2-admin/filters-dayjs'
import router from './router'
import { menuHeader, menuAside } from '@/menu'
import { frameInRoutes } from '@/router/routes'
import i18n from './i18n'
// 核心插件
Vue.use(d2Admin)
@@ -53,7 +52,6 @@ new Vue({
router,
store,
render: h => h(App),
created () {
// 处理路由 得到每一级的路由设置
this.$store.commit('d2admin/page/init', frameInRoutes)
@@ -62,7 +60,6 @@ new Vue({
// 初始化菜单搜索功能
this.$store.commit('d2admin/search/init', menuHeader)
},
mounted () {
// 展示系统信息
this.$store.commit('d2admin/releases/versionShow')
@@ -73,9 +70,6 @@ new Vue({
// 初始化全屏监听
this.$store.dispatch('d2admin/fullscreen/listen')
},
i18n,
watch: {
// 检测路由变化切换侧边栏内容
'$route.matched': {