refine: refine i18n

This commit is contained in:
Pan 2017-11-06 13:46:29 +08:00
parent e05da2650b
commit 4723a02a4b
5 changed files with 44 additions and 42 deletions

View File

@ -1,49 +1,49 @@
export default { export default {
route: { route: {
dashboard: 'dashboard', dashboard: 'Dashboard',
introduction: 'introduction', introduction: 'Introduction',
permission: 'permission', permission: 'Permission',
icons: 'icons', icons: 'Icons',
components: 'components:', components: 'Components',
componentIndex: 'introduction', componentIndex: 'Introduction',
tinymce: 'tinymce', tinymce: 'Tinymce',
markdown: 'Markdown', markdown: 'Markdown',
jsonEditor: 'JSON Editor', jsonEditor: 'JSON Editor',
dndList: 'dnd list', dndList: 'Dnd List',
splitPane: 'Splitpane', splitPane: 'SplitPane',
avatarUpload: 'avatar upload', avatarUpload: 'Avatar Upload',
dropzone: 'Dropzone', dropzone: 'Dropzone',
sticky: 'Sticky', sticky: 'Sticky',
countTo: 'CountTo', countTo: 'CountTo',
componentMixin: 'Mixin', componentMixin: 'Mixin',
backToTop: 'backToTop', backToTop: 'BackToTop',
charts: 'charts', charts: 'Charts',
chartsIndex: 'introduction', chartsIndex: 'Introduction',
keyboardChart: 'keyboard chart', keyboardChart: 'Keyboard Chart',
keyboardChart2: 'keyboard chart2', keyboardChart2: 'Keyboard Chart2',
lineChart: 'line chart', lineChart: 'Line chart',
mixChart: 'mix chart', mixChart: 'Mix Chart',
example: 'example', example: 'Example',
Table: 'Table', Table: 'Table',
dynamicTable: '动态table', dynamicTable: 'Dynamic Table',
dragTable: '拖拽table', dragTable: 'Drag Table',
inlineEditTable: 'table内编辑', inlineEditTable: 'Inline Edit',
complexTabl: '综合table', complexTable: 'Complex Table',
tab: 'Tab', tab: 'Tab',
form: 'Form', form: 'Form',
createForm: 'create form', createForm: 'Create Form',
editForm: 'edit form', editForm: 'Edit Form',
errorPages: 'error pages', errorPages: 'Error Pages',
page401: '401', page401: '401',
page404: '404', page404: '404',
errorLog: 'error log', errorLog: 'Error Log',
excel: 'excel', excel: 'Excel',
exportExcel: 'export excel', exportExcel: 'Export Excel',
selectExcel: 'export selected', selectExcel: 'Export Selected',
uploadExcel: 'upload excel', uploadExcel: 'Upload Excel',
exportZip: 'zip', exportZip: 'Zip',
theme: 'theme', theme: 'Theme',
clipboardDemo: 'clipboard', clipboardDemo: 'Clipboard',
i18n: 'i18n' i18n: 'I18n'
} }
} }

View File

@ -28,7 +28,7 @@ export default {
dynamicTable: '动态table', dynamicTable: '动态table',
dragTable: '拖拽table', dragTable: '拖拽table',
inlineEditTable: 'table内编辑', inlineEditTable: 'table内编辑',
complexTabl: '综合table', complexTable: '综合table',
tab: 'Tab', tab: 'Tab',
form: '表单', form: '表单',
createForm: '创建表单', createForm: '创建表单',

View File

@ -151,7 +151,7 @@ export const asyncRouterMap = [
{ path: 'dynamic-table', component: _import('example/table/dynamicTable/index'), name: 'dynamicTable', meta: { title: 'dynamicTable' }}, { path: 'dynamic-table', component: _import('example/table/dynamicTable/index'), name: 'dynamicTable', meta: { title: 'dynamicTable' }},
{ path: 'drag-table', component: _import('example/table/dragTable'), name: 'dragTable', meta: { title: 'dragTable' }}, { path: 'drag-table', component: _import('example/table/dragTable'), name: 'dragTable', meta: { title: 'dragTable' }},
{ path: 'inline-edit-table', component: _import('example/table/inlineEditTable'), name: 'inlineEditTable', meta: { title: 'inlineEditTable' }}, { path: 'inline-edit-table', component: _import('example/table/inlineEditTable'), name: 'inlineEditTable', meta: { title: 'inlineEditTable' }},
{ path: 'complex-table', component: _import('example/table/complexTable'), name: 'complexTable', meta: { title: 'complexTabl' }} { path: 'complex-table', component: _import('example/table/complexTable'), name: 'complexTable', meta: { title: 'complexTable' }}
] ]
}, },
{ path: 'tab/index', icon: 'tab', component: _import('example/tab/index'), name: 'tab', meta: { title: 'tab' }} { path: 'tab/index', icon: 'tab', component: _import('example/tab/index'), name: 'tab', meta: { title: 'tab' }}

View File

@ -1,8 +1,8 @@
<template> <template>
<el-breadcrumb class="app-levelbar" separator="/"> <el-breadcrumb class="app-levelbar" separator="/">
<el-breadcrumb-item v-for="(item,index) in levelList" :key="item.path" v-if='item.meta.title'> <el-breadcrumb-item v-for="(item,index) in levelList" :key="item.path" v-if='item.meta.title'>
<span v-if='item.redirect==="noredirect"||index==levelList.length-1' class="no-redirect">{{item.meta.title}}</span> <span v-if='item.redirect==="noredirect"||index==levelList.length-1' class="no-redirect">{{generateTitle(item.meta.title)}}</span>
<router-link v-else :to="item.redirect||item.path">{{item.meta.title}}</router-link> <router-link v-else :to="item.redirect||item.path">{{generateTitle(item.meta.title)}}</router-link>
</el-breadcrumb-item> </el-breadcrumb-item>
</el-breadcrumb> </el-breadcrumb>
</template> </template>
@ -26,9 +26,12 @@ export default {
} }
const first = matched[0] const first = matched[0]
if (first && first.name !== 'dashboard') { if (first && first.name !== 'dashboard') {
matched = [{ path: '/', meta: { title: '首页' }}].concat(matched) matched = [{ path: '/', meta: { title: 'dashboard' }}].concat(matched)
} }
this.levelList = matched this.levelList = matched
},
generateTitle(title) {
return this.$t('route.' + title)
} }
}, },
watch: { watch: {

View File

@ -1,13 +1,12 @@
<template> <template>
<scroll-pane class='tabs-view-container'> <scroll-pane class='tabs-view-container'>
<router-link class="tabs-view-item" :class="isActive(tag)?'active':''" v-for="tag in Array.from(visitedViews)" :to="tag.path":key="tag.path"> <router-link class="tabs-view-item" :class="isActive(tag)?'active':''" v-for="tag in Array.from(visitedViews)" :to="tag.path":key="tag.path">
{{tag.title}} {{$t('route.'+tag.title)}}
<span class='el-icon-close' @click='closeViewTabs(tag,$event)'></span> <span class='el-icon-close' @click='closeViewTabs(tag,$event)'></span>
</router-link> </router-link>
</scroll-pane> </scroll-pane>
</template> </template>
<script> <script>
import ScrollPane from '@/components/ScrollPane' import ScrollPane from '@/components/ScrollPane'