double 5 éve
szülő
commit
36154fced1
6 módosított fájl, 265 hozzáadás és 255 törlés
  1. 62 63
      src/i18n/en.js
  2. 62 63
      src/i18n/es.js
  3. 62 63
      src/i18n/ja.js
  4. 62 63
      src/i18n/zh.js
  5. 5 3
      src/layout/components/Sidebar/SidebarItem.vue
  6. 12 0
      src/utils/i18n.js

+ 62 - 63
src/i18n/en.js

@@ -8,69 +8,68 @@ export default {
     cancel: 'Cancel'
   },
   route: {
-    dashboard: 'Dashboard',
-    documentation: 'Documentation',
-    guide: 'Guide',
-    permission: 'Permission',
-    pagePermission: 'Page Permission',
-    rolePermission: 'Role Permission',
-    directivePermission: 'Directive Permission',
-    icons: 'Icons',
-    components: 'Components',
-    tinymce: 'Tinymce',
-    markdown: 'Markdown',
-    jsonEditor: 'JSON Editor',
-    dndList: 'Dnd List',
-    splitPane: 'SplitPane',
-    avatarUpload: 'Avatar Upload',
-    dropzone: 'Dropzone',
-    sticky: 'Sticky',
-    countTo: 'Count To',
-    componentMixin: 'Mixin',
-    backToTop: 'Back To Top',
-    dragDialog: 'Drag Dialog',
-    dragSelect: 'Drag Select',
-    dragKanban: 'Drag Kanban',
-    charts: 'Charts',
-    keyboardChart: 'Keyboard Chart',
-    lineChart: 'Line Chart',
-    mixChart: 'Mix Chart',
-    example: 'Example',
-    nested: 'Nested Routes',
-    menu1: 'Menu 1',
-    'menu1-1': 'Menu 1-1',
-    'menu1-2': 'Menu 1-2',
-    'menu1-2-1': 'Menu 1-2-1',
-    'menu1-2-2': 'Menu 1-2-2',
-    'menu1-3': 'Menu 1-3',
-    menu2: 'Menu 2',
-    Table: 'Table',
-    dynamicTable: 'Dynamic Table',
-    dragTable: 'Drag Table',
-    inlineEditTable: 'Inline Edit',
-    complexTable: 'Complex Table',
-    tab: 'Tab',
-    form: 'Form',
-    createArticle: 'Create Article',
-    editArticle: 'Edit Article',
-    articleList: 'Article List',
-    errorPages: 'Error Pages',
-    page401: '401',
-    page404: '404',
-    errorLog: 'Error Log',
-    excel: 'Excel',
-    exportExcel: 'Export Excel',
-    selectExcel: 'Export Selected',
-    mergeHeader: 'Merge Header',
-    uploadExcel: 'Upload Excel',
-    zip: 'Zip',
-    pdf: 'PDF',
-    exportZip: 'Export Zip',
-    theme: 'Theme',
-    clipboardDemo: 'Clipboard',
-    i18n: 'I18n',
-    externalLink: 'External Link',
-    profile: 'Profile'
+    'Dashboard': 'Dashboard',
+    'Documentation': 'Documentation',
+    'Guide': 'Guide',
+    'Permission': 'Permission',
+    'PagePermission': 'Page Permission',
+    'RolePermission': 'Role Permission',
+    'DirectivePermission': 'Directive Permission',
+    'Icons': 'Icons',
+    'Components': 'Components',
+    'Tinymce': 'Tinymce',
+    'Markdown': 'Markdown',
+    'JsonEditor': 'JSON Editor',
+    'DndList': 'Dnd List',
+    'SplitPane': 'SplitPane',
+    'AvatarUpload': 'Avatar Upload',
+    'Dropzone': 'Dropzone',
+    'Sticky': 'Sticky',
+    'CountTo': 'Count To',
+    'ComponentMixin': 'Mixin',
+    'BackToTop': 'Back To Top',
+    'DragDialog': 'Drag Dialog',
+    'DragSelect': 'Drag Select',
+    'DragKanban': 'Drag Kanban',
+    'Charts': 'Charts',
+    'KeyboardChart': 'Keyboard Chart',
+    'LineChart': 'Line Chart',
+    'MixChart': 'Mix Chart',
+    'Example': 'Example',
+    'Nested': 'Nested Routes',
+    'Menu1': 'Menu 1',
+    'Menu1-1': 'Menu 1-1',
+    'Menu1-2': 'Menu 1-2',
+    'Menu1-2-1': 'Menu 1-2-1',
+    'Menu1-2-2': 'Menu 1-2-2',
+    'Menu1-3': 'Menu 1-3',
+    'Menu2': 'Menu 2',
+    'DynamicTable': 'Dynamic Table',
+    'DragTable': 'Drag Table',
+    'InlineEditTable': 'Inline Edit',
+    'ComplexTable': 'Complex Table',
+    'Tab': 'Tab',
+    'Form': 'Form',
+    'CreateArticle': 'Create Article',
+    'EditArticle': 'Edit Article',
+    'ArticleList': 'Article List',
+    'ErrorPages': 'Error Pages',
+    'Page401': '401',
+    'Page404': '404',
+    'ErrorLog': 'Error Log',
+    'Excel': 'Excel',
+    'ExportExcel': 'Export Excel',
+    'SelectExcel': 'Export Selected',
+    'MergeHeader': 'Merge Header',
+    'UploadExcel': 'Upload Excel',
+    'Zip': 'Zip',
+    'Pdf': 'PDF',
+    'ExportZip': 'Export Zip',
+    'Theme': 'Theme',
+    'ClipboardDemo': 'Clipboard',
+    'I18n': 'I18n',
+    'ExternalLink': 'External Link',
+    'Profile': 'Profile'
   },
   navbar: {
     dashboard: 'Dashboard',

+ 62 - 63
src/i18n/es.js

@@ -8,69 +8,68 @@ export default {
     cancel: 'Cancelar'
   },
   route: {
-    dashboard: 'Panel de control',
-    documentation: 'Documentación',
-    guide: 'Guía',
-    permission: 'Permisos',
-    rolePermission: 'Permisos de rol',
-    pagePermission: 'Permisos de la página',
-    directivePermission: 'Permisos de la directiva',
-    icons: 'Iconos',
-    components: 'Componentes',
-    tinymce: 'Tinymce',
-    markdown: 'Markdown',
-    jsonEditor: 'Editor JSON',
-    dndList: 'Lista Dnd',
-    splitPane: 'Panel dividido',
-    avatarUpload: 'Subir avatar',
-    dropzone: 'Subir ficheros',
-    sticky: 'Sticky',
-    countTo: 'CountTo',
-    componentMixin: 'Mixin',
-    backToTop: 'Ir arriba',
-    dragDialog: 'Drag Dialog',
-    dragSelect: 'Drag Select',
-    dragKanban: 'Drag Kanban',
-    charts: 'Gráficos',
-    keyboardChart: 'Keyboard Chart',
-    lineChart: 'Gráfico de líneas',
-    mixChart: 'Mix Chart',
-    example: 'Ejemplo',
-    nested: 'Rutas anidadass',
-    menu1: 'Menu 1',
-    'menu1-1': 'Menu 1-1',
-    'menu1-2': 'Menu 1-2',
-    'menu1-2-1': 'Menu 1-2-1',
-    'menu1-2-2': 'Menu 1-2-2',
-    'menu1-3': 'Menu 1-3',
-    menu2: 'Menu 2',
-    Table: 'Tabla',
-    dynamicTable: 'Tabla dinámica',
-    dragTable: 'Arrastrar tabla',
-    inlineEditTable: 'Editor',
-    complexTable: 'Complex Table',
-    tab: 'Pestaña',
-    form: 'Formulario',
-    createArticle: 'Crear artículo',
-    editArticle: 'Editar artículo',
-    articleList: 'Listado de artículos',
-    errorPages: 'Páginas de error',
-    page401: '401',
-    page404: '404',
-    errorLog: 'Registro de errores',
-    excel: 'Excel',
-    exportExcel: 'Exportar a Excel',
-    selectExcel: 'Export seleccionado',
-    mergeHeader: 'Merge Header',
-    uploadExcel: 'Subir Excel',
-    zip: 'Zip',
-    pdf: 'PDF',
-    exportZip: 'Exportar a Zip',
-    theme: 'Tema',
-    clipboardDemo: 'Clipboard',
-    i18n: 'I18n',
-    externalLink: 'Enlace externo',
-    profile: 'Profile'
+    'Dashboard': 'Panel de control',
+    'Documentation': 'Documentación',
+    'Guide': 'Guía',
+    'Permission': 'Permisos',
+    'RolePermission': 'Permisos de rol',
+    'PagePermission': 'Permisos de la página',
+    'DirectivePermission': 'Permisos de la directiva',
+    'Icons': 'Iconos',
+    'Components': 'Componentes',
+    'Tinymce': 'Tinymce',
+    'Markdown': 'Markdown',
+    'JsonEditor': 'Editor JSON',
+    'DndList': 'Lista Dnd',
+    'SplitPane': 'Panel dividido',
+    'AvatarUpload': 'Subir avatar',
+    'Dropzone': 'Subir ficheros',
+    'Sticky': 'Sticky',
+    'CountTo': 'CountTo',
+    'ComponentMixin': 'Mixin',
+    'BackToTop': 'Ir arriba',
+    'DragDialog': 'Drag Dialog',
+    'DragSelect': 'Drag Select',
+    'DragKanban': 'Drag Kanban',
+    'Charts': 'Gráficos',
+    'KeyboardChart': 'Keyboard Chart',
+    'LineChart': 'Gráfico de líneas',
+    'MixChart': 'Mix Chart',
+    'Example': 'Ejemplo',
+    'Nested': 'Rutas anidadass',
+    'Menu1': 'Menu 1',
+    'Menu1-1': 'Menu 1-1',
+    'Menu1-2': 'Menu 1-2',
+    'Menu1-2-1': 'Menu 1-2-1',
+    'Menu1-2-2': 'Menu 1-2-2',
+    'Menu1-3': 'Menu 1-3',
+    'Menu2': 'Menu 2',
+    'DynamicTable': 'Tabla dinámica',
+    'DragTable': 'Arrastrar tabla',
+    'InlineEditTable': 'Editor',
+    'ComplexTable': 'Complex Table',
+    'Tab': 'Pestaña',
+    'Form': 'Formulario',
+    'CreateArticle': 'Crear artículo',
+    'EditArticle': 'Editar artículo',
+    'ArticleList': 'Listado de artículos',
+    'ErrorPages': 'Páginas de error',
+    'Page401': '401',
+    'Page404': '404',
+    'ErrorLog': 'Registro de errores',
+    'Excel': 'Excel',
+    'ExportExcel': 'Exportar a Excel',
+    'SelectExcel': 'Export seleccionado',
+    'MergeHeader': 'Merge Header',
+    'UploadExcel': 'Subir Excel',
+    'Zip': 'Zip',
+    'Pdf': 'PDF',
+    'ExportZip': 'Exportar a Zip',
+    'Theme': 'Tema',
+    'ClipboardDemo': 'Clipboard',
+    'I18n': 'I18n',
+    'ExternalLink': 'Enlace externo',
+    'Profile': 'Profile'
   },
   navbar: {
     logOut: 'Salir',

+ 62 - 63
src/i18n/ja.js

@@ -8,69 +8,68 @@ export default {
     cancel: '「キャンセル」'
   },
   route: {
-    dashboard: 'トップ',
-    documentation: 'ドキュメント',
-    guide: 'ガイド',
-    permission: '権限',
-    rolePermission: '権限ロール',
-    pagePermission: 'ページ権限',
-    directivePermission: 'ディレクティブ権限',
-    icons: 'アイコン',
-    components: 'コンポーネント',
-    tinymce: 'TinyMCE',
-    markdown: 'Markdown',
-    jsonEditor: 'JSON Editor',
-    dndList: 'Drag-And-Drop',
-    splitPane: 'パネル',
-    avatarUpload: 'アバターアップロード',
-    dropzone: 'Dropzone',
-    sticky: 'Sticky',
-    countTo: 'Count To',
-    componentMixin: 'コンポーネントMixin',
-    backToTop: 'BackToTop',
-    dragDialog: 'Drag Dialog',
-    dragSelect: 'Drag Select',
-    dragKanban: 'Drag 看板',
-    charts: 'チャート',
-    keyboardChart: 'Keyboardチャート',
-    lineChart: 'Lineチャート',
-    mixChart: 'Mixチャート',
-    example: 'Example',
-    nested: 'Nested Routes',
-    menu1: 'メニュー1',
-    'menu1-1': 'メニュー 1-1',
-    'menu1-2': 'メニュー 1-2',
-    'menu1-2-1': 'メニュー 1-2-1',
-    'menu1-2-2': 'メニュー 1-2-2',
-    'menu1-3': 'メニュー 1-3',
-    menu2: 'メニュー 2',
-    Table: 'Table',
-    dynamicTable: '可変 Table',
-    dragTable: 'Drag Table',
-    inlineEditTable: 'Inline Edit Table',
-    complexTable: 'Complex Table',
-    tab: 'Tab',
-    form: 'フォーム',
-    createArticle: '投稿作成',
-    editArticle: '投稿編集',
-    articleList: '投稿リスト',
-    errorPages: 'エラーページ',
-    page401: '401',
-    page404: '404',
-    errorLog: 'エラーログ',
-    excel: 'Excel',
-    exportExcel: '一括エクスポート',
-    selectExcel: '複数選択エクスポート',
-    mergeHeader: 'ヘッダーマージ',
-    uploadExcel: 'アップロード',
-    zip: 'Zip',
-    pdf: 'PDF',
-    exportZip: 'Export Zip',
-    theme: 'テーマ変更',
-    clipboardDemo: 'Clipboard',
-    i18n: '多言語',
-    externalLink: '外部リンク',
-    profile: 'プロフィール'
+    'Dashboard': 'トップ',
+    'Documentation': 'ドキュメント',
+    'Guide': 'ガイド',
+    'Permission': '権限',
+    'RolePermission': '権限ロール',
+    'PagePermission': 'ページ権限',
+    'DirectivePermission': 'ディレクティブ権限',
+    'Icons': 'アイコン',
+    'Components': 'コンポーネント',
+    'Tinymce': 'TinyMCE',
+    'Markdown': 'Markdown',
+    'JsonEditor': 'JSON Editor',
+    'DndList': 'Drag-And-Drop',
+    'SplitPane': 'パネル',
+    'AvatarUpload': 'アバターアップロード',
+    'Dropzone': 'Dropzone',
+    'Sticky': 'Sticky',
+    'CountTo': 'Count To',
+    'ComponentMixin': 'コンポーネントMixin',
+    'BackToTop': 'BackToTop',
+    'DragDialog': 'Drag Dialog',
+    'DragSelect': 'Drag Select',
+    'DragKanban': 'Drag 看板',
+    'Charts': 'チャート',
+    'KeyboardChart': 'Keyboardチャート',
+    'LineChart': 'Lineチャート',
+    'MixChart': 'Mixチャート',
+    'Example': 'Example',
+    'Nested': 'Nested Routes',
+    'Menu1': 'メニュー1',
+    'Menu1-1': 'メニュー 1-1',
+    'Menu1-2': 'メニュー 1-2',
+    'Menu1-2-1': 'メニュー 1-2-1',
+    'Menu1-2-2': 'メニュー 1-2-2',
+    'Menu1-3': 'メニュー 1-3',
+    'Menu2': 'メニュー 2',
+    'DynamicTable': '可変 Table',
+    'DragTable': 'Drag Table',
+    'InlineEditTable': 'Inline Edit Table',
+    'ComplexTable': 'Complex Table',
+    'Tab': 'Tab',
+    'Form': 'フォーム',
+    'CreateArticle': '投稿作成',
+    'EditArticle': '投稿編集',
+    'ArticleList': '投稿リスト',
+    'ErrorPages': 'エラーページ',
+    'Page401': '401',
+    'Page404': '404',
+    'ErrorLog': 'エラーログ',
+    'Excel': 'Excel',
+    'ExportExcel': '一括エクスポート',
+    'SelectExcel': '複数選択エクスポート',
+    'MergeHeader': 'ヘッダーマージ',
+    'UploadExcel': 'アップロード',
+    'Zip': 'Zip',
+    'Pdf': 'PDF',
+    'ExportZip': 'Export Zip',
+    'Theme': 'テーマ変更',
+    'ClipboardDemo': 'Clipboard',
+    'I18n': '多言語',
+    'ExternalLink': '外部リンク',
+    'Profile': 'プロフィール'
   },
   navbar: {
     dashboard: 'トップ',

+ 62 - 63
src/i18n/zh.js

@@ -8,69 +8,68 @@ export default {
     cancel: '取消'
   },
   route: {
-    dashboard: '首页',
-    documentation: '文档',
-    guide: '引导页',
-    permission: '权限测试页',
-    rolePermission: '角色权限',
-    pagePermission: '页面权限',
-    directivePermission: '指令权限',
-    icons: '图标',
-    components: '组件',
-    tinymce: '富文本编辑器',
-    markdown: 'Markdown',
-    jsonEditor: 'JSON 编辑器',
-    dndList: '列表拖拽',
-    splitPane: 'Splitpane',
-    avatarUpload: '头像上传',
-    dropzone: 'Dropzone',
-    sticky: 'Sticky',
-    countTo: 'Count To',
-    componentMixin: '小组件',
-    backToTop: '返回顶部',
-    dragDialog: '拖拽 Dialog',
-    dragSelect: '拖拽 Select',
-    dragKanban: '可拖拽看板',
-    charts: '图表',
-    keyboardChart: '键盘图表',
-    lineChart: '折线图',
-    mixChart: '混合图表',
-    example: '综合实例',
-    nested: '路由嵌套',
-    menu1: '菜单1',
-    'menu1-1': '菜单 1-1',
-    'menu1-2': '菜单 1-2',
-    'menu1-2-1': '菜单 1-2-1',
-    'menu1-2-2': '菜单 1-2-2',
-    'menu1-3': '菜单 1-3',
-    menu2: '菜单 2',
-    Table: 'Table',
-    dynamicTable: '动态 Table',
-    dragTable: '拖拽 Table',
-    inlineEditTable: 'Table 内编辑',
-    complexTable: '综合 Table',
-    tab: 'Tab',
-    form: '表单',
-    createArticle: '创建文章',
-    editArticle: '编辑文章',
-    articleList: '文章列表',
-    errorPages: '错误页面',
-    page401: '401',
-    page404: '404',
-    errorLog: '错误日志',
-    excel: 'Excel',
-    exportExcel: '导出 Excel',
-    selectExcel: '导出 已选择项',
-    mergeHeader: '导出 多级表头',
-    uploadExcel: '上传 Excel',
-    zip: 'Zip',
-    pdf: 'PDF',
-    exportZip: 'Export Zip',
-    theme: '换肤',
-    clipboardDemo: 'Clipboard',
-    i18n: '国际化',
-    externalLink: '外链',
-    profile: '个人中心'
+    'Dashboard': '首页',
+    'Documentation': '文档',
+    'Guide': '引导页',
+    'Permission': '权限测试页',
+    'RolePermission': '角色权限',
+    'PagePermission': '页面权限',
+    'DirectivePermission': '指令权限',
+    'Icons': '图标',
+    'Components': '组件',
+    'Tinymce': '富文本编辑器',
+    'Markdown': 'Markdown',
+    'JsonEditor': 'JSON 编辑器',
+    'DndList': '列表拖拽',
+    'SplitPane': 'Splitpane',
+    'AvatarUpload': '头像上传',
+    'Dropzone': 'Dropzone',
+    'Sticky': 'Sticky',
+    'CountTo': 'Count To',
+    'ComponentMixin': '小组件',
+    'BackToTop': '返回顶部',
+    'DragDialog': '拖拽 Dialog',
+    'DragSelect': '拖拽 Select',
+    'DragKanban': '可拖拽看板',
+    'Charts': '图表',
+    'KeyboardChart': '键盘图表',
+    'LineChart': '折线图',
+    'MixChart': '混合图表',
+    'Example': '综合实例',
+    'Nested': '路由嵌套',
+    'Menu1': '菜单1',
+    'Menu1-1': '菜单 1-1',
+    'Menu1-2': '菜单 1-2',
+    'Menu1-2-1': '菜单 1-2-1',
+    'Menu1-2-2': '菜单 1-2-2',
+    'Menu1-3': '菜单 1-3',
+    'Menu2': '菜单 2',
+    'DynamicTable': '动态 Table',
+    'DragTable': '拖拽 Table',
+    'InlineEditTable': 'Table 内编辑',
+    'ComplexTable': '综合 Table',
+    'Tab': 'Tab',
+    'Form': '表单',
+    'CreateArticle': '创建文章',
+    'EditArticle': '编辑文章',
+    'ArticleList': '文章列表',
+    'ErrorPages': '错误页面',
+    'Page401': '401',
+    'Page404': '404',
+    'ErrorLog': '错误日志',
+    'Excel': 'Excel',
+    'ExportExcel': '导出 Excel',
+    'SelectExcel': '导出 已选择项',
+    'MergeHeader': '导出 多级表头',
+    'UploadExcel': '上传 Excel',
+    'Zip': 'Zip',
+    'Pdf': 'PDF',
+    'ExportZip': 'Export Zip',
+    'Theme': '换肤',
+    'ClipboardDemo': 'Clipboard',
+    'I18n': '国际化',
+    'ExternalLink': '外链',
+    'Profile': '个人中心'
   },
   navbar: {
     dashboard: '首页',

+ 5 - 3
src/layout/components/Sidebar/SidebarItem.vue

@@ -3,14 +3,14 @@
     <template v-if="hasOneShowingChild(item.children,item) && (!onlyOneChild.children||onlyOneChild.noShowingChildren)&&!item.alwaysShow">
       <app-link v-if="onlyOneChild.meta" :to="resolvePath(onlyOneChild.path)">
         <el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{'submenu-title-noDropdown':!isNest}">
-          <item :icon="onlyOneChild.meta.icon||(item.meta&&item.meta.icon)" :title="onlyOneChild.meta.title" />
+          <item :icon="onlyOneChild.meta.icon||(item.meta&&item.meta.icon)" :title="generateTitle(onlyOneChild.meta.title)" />
         </el-menu-item>
       </app-link>
     </template>
 
     <el-submenu v-else ref="subMenu" :index="resolvePath(item.path)" popper-append-to-body>
       <template slot="title">
-        <item v-if="item.meta" :icon="item.meta && item.meta.icon" :title="item.meta.title" />
+        <item v-if="item.meta" :icon="item.meta && item.meta.icon" :title="generateTitle(item.meta.title)" />
       </template>
       <sidebar-item
         v-for="child in item.children"
@@ -26,6 +26,7 @@
 
 <script>
 import path from 'path'
+import { generateTitle } from '@/utils/i18n'
 import { isExternal } from '@/utils/validate'
 import Item from './Item'
 import AppLink from './Link'
@@ -89,7 +90,8 @@ export default {
         return this.basePath
       }
       return path.resolve(this.basePath, routePath)
-    }
+    },
+    generateTitle
   }
 }
 </script>

+ 12 - 0
src/utils/i18n.js

@@ -0,0 +1,12 @@
+// translate router.meta.title, be used in breadcrumb sidebar tagsview
+export function generateTitle(title) {
+  const hasKey = this.$te('route.' + title)
+
+  if (hasKey) {
+    // $t :this method from vue-i18n, inject in @/lang/index.js
+    const translatedTitle = this.$t('route.' + title)
+
+    return translatedTitle
+  }
+  return title
+}