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

9
.env
View File

@@ -1,5 +1,10 @@
# 所有环境默认
# 页面 title 前缀
VUE_APP_TITLE=D2Admin
# 网络请求公用地址
VUE_APP_API=/api/
# 仓库地址
VUE_APP_REPO=https://github.com/d2-projects/d2-admin
VUE_APP_I18N_LOCALE=en
VUE_APP_I18N_FALLBACK_LOCALE=en

View File

@@ -3,14 +3,13 @@
"version": "1.7.0",
"scripts": {
"serve": "vue-cli-service serve --open",
"start": "npm run serve",
"dev": "npm run serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint --fix",
"build:netlify": "vue-cli-service build --mode netlify",
"build:nomock": "vue-cli-service build --mode nomock",
"build:travis": "vue-cli-service build --mode travis",
"dev": "npm run serve",
"i18n:report": "vue-cli-service i18n:report --src './src/**/*.?(js|vue)' --locales './src/locales/**/*.json'",
"start": "npm run serve",
"build:netlify": "vue-cli-service build --mode netlify",
"lint": "vue-cli-service lint --fix",
"test:unit": "vue-cli-service test:unit"
},
"dependencies": {
@@ -46,7 +45,6 @@
"v-contextmenu": "^2.8.0",
"vue": "^2.6.10",
"vue-grid-layout": "^2.3.4",
"vue-i18n": "^8.0.0",
"vue-json-tree-view": "^2.1.4",
"vue-router": "^3.0.3",
"vue-splitpane": "^1.0.4",
@@ -70,7 +68,6 @@
"svg-sprite-loader": "^4.1.3",
"text-loader": "0.0.1",
"uglifyjs-webpack-plugin": "^2.1.2",
"vue-cli-plugin-i18n": "^0.6.0",
"vue-template-compiler": "^2.5.21"
}
}

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': {

View File

@@ -12,15 +12,11 @@ process.env.VUE_APP_BUILD_TIME = require('dayjs')().format('YYYY-M-D HH:mm:ss')
let publicPath = '/'
module.exports = {
// 根据你的实际情况更改这里
publicPath,
publicPath, // 根据你的实际情况更改这里
lintOnSave: true,
devServer: {
publicPath // 和 publicPath 保持一致
},
css: {
loaderOptions: {
// 设置 scss 公用变量文件
@@ -29,7 +25,6 @@ module.exports = {
}
}
},
// 默认设置: https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-service/lib/config/base.js
chainWebpack: config => {
/**
@@ -110,14 +105,5 @@ module.exports = {
.add('@/mock')
.end()
}
},
pluginOptions: {
i18n: {
locale: 'en',
fallbackLocale: 'en',
localeDir: 'locales',
enableInSFC: false
}
}
}

View File

@@ -1 +0,0 @@
1de11ec632cee64f600400ccff46f90fd4761a05