Former-commit-id: 37608fe7e3f1f13228f49e43acd308ca70e018af [formerly 37608fe7e3f1f13228f49e43acd308ca70e018af [formerly 37608fe7e3f1f13228f49e43acd308ca70e018af [formerly 37608fe7e3f1f13228f49e43acd308ca70e018af [formerly 8d2456f102e81311c88bd89e394862901c445f91 [formerly 6a3437ca1e6594caeed818c0b4665c4e668150ff]]]]]
Former-commit-id: 0b8228b1604c77a4aae173f0ad368842de1cb378
Former-commit-id: 6928d67f87d054c07eb51dccac226419bc36ed68
Former-commit-id: fd8a0be47d7a7d9bb1d0cdef4dc0d24542c5e059 [formerly 111b39532b91144f4b0780123cfd80771841d873]
Former-commit-id: c48ef56806c4c1aa3c6e7842f08096cada9d8db2
Former-commit-id: 06688d30e09a8cc7910f7d349a47b7a571f3d5d6
Former-commit-id: f7031baba83463b2a3e4bc397e352ffc35f4fe0e
Former-commit-id: 99597c4aae58bbd1a00598572316e405c2c0fcb6
Former-commit-id: 55f5407f9946ec65c168f6c2ef1405ff6676a1e6
This commit is contained in:
liyang 2019-05-22 00:19:48 +08:00
parent 7e5bd78fdb
commit 005d248dd6
6 changed files with 56 additions and 34 deletions

51
locales.babel Normal file
View File

@ -0,0 +1,51 @@
<babeledit_project version="1.2">
<!--
BabelEdit project file
https://www.codeandweb.com/babeledit
This file contains meta data for all translations, but not the translation texts itself.
They are stored in framework-specific message files (.json / .vue / .yaml / .properties)
-->
<preset_collections/>
<framework>vue-json</framework>
<filename>locales.babel</filename>
<folder_node>
<name></name>
<children/>
</folder_node>
<isTemplateProject>false</isTemplateProject>
<languages>
<language>
<code>en-US</code>
<source_id></source_id>
<source_file>src/locales/en.json</source_file>
</language>
<language>
<code>zh-CN</code>
<source_id></source_id>
<source_file>src/locales/zh.json</source_file>
</language>
</languages>
<translation_files>
<translation_file>
<file>src/locales/en.json</file>
</translation_file>
<translation_file>
<file>src/locales/zh.json</file>
</translation_file>
</translation_files>
<editor_configuration>
<copy_templates>
<copy_template>$t('%1')</copy_template>
<copy_template></copy_template>
<copy_template></copy_template>
</copy_templates>
</editor_configuration>
<primary_language>zh-CN</primary_language>
<configuration>
<indent>tab</indent>
<format>namespaced-json</format>
</configuration>
</babeledit_project>

View File

@ -1,17 +0,0 @@
<template>
<p>{{ $t('hello') }}</p>
</template>
<script>
export default {
name: 'HelloI18n'
}
</script>
<i18n>
{
"en": {
"hello": "Hello i18n in SFC!"
}
}
</i18n>

View File

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

View File

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

View File

@ -1,5 +1,6 @@
// Vue
import Vue from 'vue'
import i18n from './i18n'
import App from './App'
// 核心插件
import d2Admin from '@/plugin/d2admin'
@ -31,7 +32,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)
@ -52,8 +52,8 @@ Vue.component('VueUeditorWrap', VueUeditorWrap)
new Vue({
router,
store,
i18n,
render: h => h(App),
created () {
// 处理路由 得到每一级的路由设置
this.$store.commit('d2admin/page/init', frameInRoutes)
@ -62,7 +62,6 @@ new Vue({
// 初始化菜单搜索功能
this.$store.commit('d2admin/search/init', menuHeader)
},
mounted () {
// 展示系统信息
this.$store.commit('d2admin/releases/versionShow')
@ -73,9 +72,6 @@ new Vue({
// 初始化全屏监听
this.$store.dispatch('d2admin/fullscreen/listen')
},
i18n,
watch: {
// 检测路由变化切换侧边栏内容
'$route.matched': {

View File

@ -14,13 +14,10 @@ let publicPath = '/'
module.exports = {
// 根据你的实际情况更改这里
publicPath,
lintOnSave: true,
devServer: {
publicPath // 和 publicPath 保持一致
},
css: {
loaderOptions: {
// 设置 scss 公用变量文件
@ -29,7 +26,6 @@ module.exports = {
}
}
},
// 默认设置: https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-service/lib/config/base.js
chainWebpack: config => {
/**
@ -111,7 +107,7 @@ module.exports = {
.end()
}
},
// i18n
pluginOptions: {
i18n: {
locale: 'en',