From 3338ea64d377244ed07f930009b9a654215f3dd6 Mon Sep 17 00:00:00 2001
From: Svamei <357810508@qq.com>
Date: Mon, 3 Apr 2023 13:01:43 +0800
Subject: [PATCH] Complete the text translation of the 'Sidebar Menu'
---
.../src/components/Breadcrumb/index.vue | 4 +-
hippo4j-ui/src/layout/components/Navbar.vue | 2 +-
.../layout/components/Sidebar/SidebarItem.vue | 4 +-
hippo4j-ui/src/locale/lang/en.js | 28 +++++++++
hippo4j-ui/src/locale/lang/zh.js | 28 +++++++++
hippo4j-ui/src/permission.js | 3 +-
hippo4j-ui/src/router/index.js | 60 +++++++++----------
7 files changed, 93 insertions(+), 36 deletions(-)
diff --git a/hippo4j-ui/src/components/Breadcrumb/index.vue b/hippo4j-ui/src/components/Breadcrumb/index.vue
index e224ff73..0637e734 100755
--- a/hippo4j-ui/src/components/Breadcrumb/index.vue
+++ b/hippo4j-ui/src/components/Breadcrumb/index.vue
@@ -2,8 +2,8 @@
- {{ item.meta.title }}
- {{ item.meta.title }}
+ {{ $t(item.meta.title) }}
+ {{ $t(item.meta.title) }}
diff --git a/hippo4j-ui/src/layout/components/Navbar.vue b/hippo4j-ui/src/layout/components/Navbar.vue
index 283431ff..57cbb912 100755
--- a/hippo4j-ui/src/layout/components/Navbar.vue
+++ b/hippo4j-ui/src/layout/components/Navbar.vue
@@ -29,7 +29,7 @@
Profile
-->
- Dashboard
+ {{ this.$t('menu.dashboard') }}
{{ $t('system.logOut') }}
diff --git a/hippo4j-ui/src/layout/components/Sidebar/SidebarItem.vue b/hippo4j-ui/src/layout/components/Sidebar/SidebarItem.vue
index 4a3c1a0b..52746998 100755
--- a/hippo4j-ui/src/layout/components/Sidebar/SidebarItem.vue
+++ b/hippo4j-ui/src/layout/components/Sidebar/SidebarItem.vue
@@ -3,14 +3,14 @@
-
+
-
+
{
NProgress.start();
// set page title
- document.title = getPageTitle(to.meta.title);
+ document.title = getPageTitle(i18n.t(to.meta.title));
// determine whether the user has logged in
const hasToken = getToken();
diff --git a/hippo4j-ui/src/router/index.js b/hippo4j-ui/src/router/index.js
index 3e1b5c9a..bf3e9fd1 100755
--- a/hippo4j-ui/src/router/index.js
+++ b/hippo4j-ui/src/router/index.js
@@ -47,7 +47,7 @@ export const constantRoutes = [
path: 'dashboard',
component: () => import('@/views/dashboard/admin/index'),
name: 'Dashboard',
- meta: { title: '运行报表', icon: 'dashboard2', affix: true },
+ meta: { title: 'menu.dashboard', icon: 'dashboard2', affix: true },
},
],
},
@@ -107,13 +107,13 @@ export const asyncRoutes = [
component: Layout,
redirect: '/hippo4j/tenantList',
name: 'tenant',
- meta: { title: '租户管理', icon: 'lessee' },
+ meta: { title: 'menu.tenantManage', icon: 'lessee' },
children: [
{
path: 'index',
name: 'index',
component: () => import('@/views/hippo4j/tenant/index'),
- meta: { title: '租户管理', icon: 'lessee' },
+ meta: { title: 'menu.tenantManage', icon: 'lessee' },
},
],
},
@@ -122,13 +122,13 @@ export const asyncRoutes = [
component: Layout,
redirect: '/hippo4j/itemList',
name: 'item',
- meta: { title: '项目管理', icon: 'item' },
+ meta: { title: 'menu.itemManage', icon: 'item' },
children: [
{
path: 'index',
name: 'index',
component: () => import('@/views/hippo4j/item/index'),
- meta: { title: '项目管理', icon: 'item' },
+ meta: { title: 'menu.itemManage', icon: 'item' },
},
],
},
@@ -138,25 +138,25 @@ export const asyncRoutes = [
component: Layout,
redirect: '/hippo4j/dynamic/thread-pool',
name: 'thread-pool',
- meta: { title: '动态线程池', icon: 'pool' },
+ meta: { title: 'menu.dynamicThreadPool', icon: 'pool' },
children: [
{
path: 'index',
name: 'index',
component: () => import('@/views/hippo4j/threadpool/index'),
- meta: { title: '线程池管理' },
+ meta: { title: 'menu.threadPoolManage' },
},
{
path: 'instance',
name: 'instance',
component: () => import('@/views/hippo4j/instance/index'),
- meta: { title: '线程池实例' },
+ meta: { title: 'menu.threadPoolInstance' },
},
{
path: 'monitor',
name: 'monitor',
component: () => import('@/views/hippo4j/monitor/index'),
- meta: { title: '线程池监控' },
+ meta: { title: 'menu.threadPoolMonitor' },
},
],
},
@@ -165,25 +165,25 @@ export const asyncRoutes = [
component: Layout,
redirect: '/hippo4j/server',
name: 'server-thread-pool',
- meta: { title: '容器线程池', icon: 'vessel' },
+ meta: { title: 'menu.containerThreadPool', icon: 'vessel' },
children: [
{
path: 'tomcat',
name: 'tomcat',
component: () => import('@/views/hippo4j/server/tomcat/index'),
- meta: { title: 'Tomcat' },
+ meta: { title: 'menu.tomcat' },
},
{
path: 'undertow',
name: 'undertow',
component: () => import('@/views/hippo4j/server/undertow/index'),
- meta: { title: 'Undertow' },
+ meta: { title: 'menu.undertow' },
},
{
path: 'jetty',
name: 'jetty',
component: () => import('@/views/hippo4j/server/jetty/index'),
- meta: { title: 'Jetty' },
+ meta: { title: 'menu.jetty' },
},
],
},
@@ -192,49 +192,49 @@ export const asyncRoutes = [
component: Layout,
redirect: '/hippo4j/other',
name: 'other-thread-pool',
- meta: { title: '框架线程池', icon: 'other' },
+ meta: { title: 'menu.frameworkThreadPool', icon: 'other' },
children: [
{
path: 'dubbo',
name: 'dubbo',
component: () => import('@/views/hippo4j/other/dubbo/index'),
- meta: { title: 'Dubbo' },
+ meta: { title: 'menu.dubbo' },
},
{
path: 'hystrix',
name: 'hystrix',
component: () => import('@/views/hippo4j/other/hystrix/index'),
- meta: { title: 'Hystrix' },
+ meta: { title: 'menu.hystrix' },
},
{
path: 'rabbitmq',
name: 'rabbitmq',
component: () => import('@/views/hippo4j/other/rabbitmq/index'),
- meta: { title: 'RabbitMQ' },
+ meta: { title: 'menu.rabbitMQ' },
},
{
path: 'rocketmq',
name: 'rocketmq',
component: () => import('@/views/hippo4j/other/rocketmq/index'),
- meta: { title: 'RocketMQ' },
+ meta: { title: 'menu.rocketMQ' },
},
{
path: 'alibaba-dubbo',
name: 'alibaba-dubbo',
component: () => import('@/views/hippo4j/other/alibaba-dubbo/index'),
- meta: { title: 'AlibabaDubbo' },
+ meta: { title: 'menu.alibabaDubbo' },
},
{
path: 'rabbitmq-stream',
name: 'rabbitmq-stream',
component: () => import('@/views/hippo4j/other/rabbitmq-stream/index'),
- meta: { title: 'RabbitMQStream' },
+ meta: { title: 'menu.rabbitMQStream' },
},
{
path: 'rocketmq-stream',
name: 'rocketmq-stream',
component: () => import('@/views/hippo4j/other/rocketmq-stream/index'),
- meta: { title: 'RocketMQStream' },
+ meta: { title: 'menu.rocketMQStream' },
},
],
},
@@ -243,13 +243,13 @@ export const asyncRoutes = [
component: Layout,
redirect: '/hippo4j/verifyList',
name: 'config-modification-verify',
- meta: { title: '线程池审核', icon: 'audit', roles: ['ROLE_MANAGE', 'ROLE_ADMIN'] },
+ meta: { title: 'menu.threadPoolAudit', icon: 'audit', roles: ['ROLE_MANAGE', 'ROLE_ADMIN'] },
children: [
{
path: 'index',
name: 'index',
component: () => import('@/views/hippo4j/verify/index'),
- meta: { title: '线程池审核', icon: 'audit' },
+ meta: { title: 'menu.threadPoolAudit', icon: 'audit' },
},
],
},
@@ -258,13 +258,13 @@ export const asyncRoutes = [
component: Layout,
redirect: '/hippo4j/notifyList',
name: 'notify',
- meta: { title: '通知报警', icon: 'notify' },
+ meta: { title: 'menu.notifyAlarm', icon: 'notify' },
children: [
{
path: 'index',
name: 'index',
component: () => import('@/views/hippo4j/notify/index'),
- meta: { title: '通知报警', icon: 'notify' },
+ meta: { title: 'menu.notifyAlarm', icon: 'notify' },
},
],
},
@@ -273,13 +273,13 @@ export const asyncRoutes = [
component: Layout,
redirect: '/hippo4j/userList',
name: 'user',
- meta: { title: '用户权限', icon: 'user', roles: ['ROLE_ADMIN'] },
+ meta: { title: 'menu.userAuthority', icon: 'user', roles: ['ROLE_ADMIN'] },
children: [
{
path: 'index',
name: 'index',
component: () => import('@/views/hippo4j/user/index'),
- meta: { title: '用户权限', icon: 'user' },
+ meta: { title: 'menu.userAuthority', icon: 'user' },
},
],
},
@@ -288,13 +288,13 @@ export const asyncRoutes = [
component: Layout,
redirect: '/hippo4j/logList',
name: 'log',
- meta: { title: '日志管理', icon: 'log' },
+ meta: { title: 'menu.logManage', icon: 'log' },
children: [
{
path: 'index',
name: 'index',
component: () => import('@/views/hippo4j/log/index'),
- meta: { title: '日志管理', icon: 'log' },
+ meta: { title: 'menu.logManage', icon: 'log' },
},
],
},
@@ -305,7 +305,7 @@ export const asyncRoutes = [
children: [
{
path: 'https://hippo4j.cn',
- meta: { title: '官网外链', icon: 'link' },
+ meta: { title: 'menu.officialWebsite', icon: 'link' },
},
],
},