Skip to content

Commit

Permalink
feat(projects): add menu translate [翻译菜单]
Browse files Browse the repository at this point in the history
  • Loading branch information
honghuangdc committed May 13, 2023
1 parent 85b8ef8 commit f68285f
Show file tree
Hide file tree
Showing 12 changed files with 244 additions and 8 deletions.
70 changes: 67 additions & 3 deletions src/locales/lang/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,73 @@ const locale: LocaleMessages<I18nType.Schema> = {
analysis: 'Analysis',
workbench: 'Workbench'
},
about: {
about: 'About'
}
document: {
_value: 'Document',
vue: 'Vue Document',
vite: 'Vite Document',
naive: 'NaiveUI Document',
project: 'Project Document',
'project-link': 'Project Document(href)'
},
component: {
_value: 'Component',
button: 'Button',
card: 'Card',
table: 'Table'
},
plugin: {
_value: 'Plugin',
charts: {
_value: 'Chart',
echarts: 'ECharts',
antv: 'AntV'
},
copy: 'Copy',
editor: {
_value: 'Editor',
quill: 'Quill',
markdown: 'Markdown'
},
icon: 'Icon',
map: 'Map',
print: 'Print',
swiper: 'Swiper',
video: 'Video'
},
'auth-demo': {
_value: 'Auth Demo',
permission: 'Toggle Permission',
super: 'Super Auth'
},
function: {
_value: 'Function',
tab: 'System Tab'
},
exception: {
_value: 'Exception',
403: '403',
404: '404',
500: '500'
},
'multi-menu': {
_value: 'Multi Degree Menu',
first: {
_value: 'First Degree',
second: 'Second Degree',
'second-new': {
_value: 'Second Degree With Children',
third: 'Third Degree'
}
}
},
management: {
_value: 'System Management',
auth: 'Auth',
role: 'Role',
route: 'Route',
user: 'User'
},
about: 'About'
}
}
};
Expand Down
70 changes: 67 additions & 3 deletions src/locales/lang/zh-cn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,73 @@ const locale: LocaleMessages<I18nType.Schema> = {
analysis: '分析页',
workbench: '工作台'
},
about: {
about: '关于'
}
document: {
_value: '文档',
vue: 'Vue文档',
vite: 'Vite文档',
naive: 'NaiveUI文档',
project: '项目文档',
'project-link': '项目文档(外链)'
},
component: {
_value: '组件示例',
button: '按钮',
card: '卡片',
table: '表格'
},
plugin: {
_value: '插件示例',
charts: {
_value: '图表',
echarts: 'ECharts',
antv: 'AntV'
},
copy: '剪贴板',
editor: {
_value: '编辑器',
quill: '富文本',
markdown: 'Markdown'
},
icon: '图标',
map: '地图',
print: '打印',
swiper: 'Swiper',
video: '视频'
},
'auth-demo': {
_value: '权限示例',
permission: '切换权限',
super: '超级管理员可见'
},
function: {
_value: '功能',
tab: 'Tab页签'
},
exception: {
_value: '异常页',
403: '403',
404: '404',
500: '500'
},
'multi-menu': {
_value: '多级菜单',
first: {
_value: '一级菜单',
second: '二级菜单',
'second-new': {
_value: '二级菜单(有子菜单)',
third: '三级菜单'
}
}
},
management: {
_value: '系统管理',
auth: '权限管理',
role: '角色管理',
route: '路由管理',
user: '用户管理'
},
about: '关于'
}
}
};
Expand Down
1 change: 1 addition & 0 deletions src/router/modules/about.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const about1: AuthRoute.Route = {
component: 'self',
meta: {
title: '关于',
i18nTitle: 'message.routes.about',
requiresAuth: true,
keepAlive: true,
singleLayout: 'basic',
Expand Down
3 changes: 3 additions & 0 deletions src/router/modules/auth-demo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const authDemo: AuthRoute.Route = {
component: 'self',
meta: {
title: '权限切换',
i18nTitle: 'message.routes.auth-demo.permission',
requiresAuth: true,
icon: 'ic:round-construction'
}
Expand All @@ -19,6 +20,7 @@ const authDemo: AuthRoute.Route = {
component: 'self',
meta: {
title: '超级管理员可见',
i18nTitle: 'message.routes.auth-demo.super',
requiresAuth: true,
permissions: ['super'],
icon: 'ic:round-supervisor-account'
Expand All @@ -27,6 +29,7 @@ const authDemo: AuthRoute.Route = {
],
meta: {
title: '权限示例',
i18nTitle: 'message.routes.auth-demo._value',
icon: 'ic:baseline-security',
order: 5
}
Expand Down
4 changes: 4 additions & 0 deletions src/router/modules/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const component: AuthRoute.Route = {
component: 'self',
meta: {
title: '按钮',
i18nTitle: 'message.routes.component.button',
requiresAuth: true,
icon: 'mdi:button-cursor'
}
Expand All @@ -19,6 +20,7 @@ const component: AuthRoute.Route = {
component: 'self',
meta: {
title: '卡片',
i18nTitle: 'message.routes.component.card',
requiresAuth: true,
icon: 'mdi:card-outline'
}
Expand All @@ -29,13 +31,15 @@ const component: AuthRoute.Route = {
component: 'self',
meta: {
title: '表格',
i18nTitle: 'message.routes.component.table',
requiresAuth: true,
icon: 'mdi:table-large'
}
}
],
meta: {
title: '组件示例',
i18nTitle: 'message.routes.component._value',
icon: 'cib:app-store',
order: 3
}
Expand Down
6 changes: 6 additions & 0 deletions src/router/modules/document.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const document: AuthRoute.Route = {
component: 'self',
meta: {
title: 'vue文档',
i18nTitle: 'message.routes.document.vue',
requiresAuth: true,
icon: 'logos:vue'
}
Expand All @@ -19,6 +20,7 @@ const document: AuthRoute.Route = {
component: 'self',
meta: {
title: 'vite文档',
i18nTitle: 'message.routes.document.vite',
requiresAuth: true,
icon: 'logos:vitejs'
}
Expand All @@ -29,6 +31,7 @@ const document: AuthRoute.Route = {
component: 'self',
meta: {
title: 'naive文档',
i18nTitle: 'message.routes.document.naive',
requiresAuth: true,
icon: 'logos:naiveui'
}
Expand All @@ -39,6 +42,7 @@ const document: AuthRoute.Route = {
component: 'self',
meta: {
title: '项目文档',
i18nTitle: 'message.routes.document.project',
requiresAuth: true,
localIcon: 'logo'
}
Expand All @@ -48,6 +52,7 @@ const document: AuthRoute.Route = {
path: '/document/project-link',
meta: {
title: '项目文档(外链)',
i18nTitle: 'message.routes.document.project-link',
requiresAuth: true,
localIcon: 'logo',
href: 'https://docs.soybean.pro/'
Expand All @@ -56,6 +61,7 @@ const document: AuthRoute.Route = {
],
meta: {
title: '文档',
i18nTitle: 'message.routes.document._value',
icon: 'mdi:file-document-multiple-outline',
order: 2
}
Expand Down
4 changes: 4 additions & 0 deletions src/router/modules/exception.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const exception: AuthRoute.Route = {
component: 'self',
meta: {
title: '异常页403',
i18nTitle: 'message.routes.exception.403',
requiresAuth: true,
icon: 'ic:baseline-block'
}
Expand All @@ -19,6 +20,7 @@ const exception: AuthRoute.Route = {
component: 'self',
meta: {
title: '异常页404',
i18nTitle: 'message.routes.exception.404',
requiresAuth: true,
icon: 'ic:baseline-web-asset-off'
}
Expand All @@ -29,12 +31,14 @@ const exception: AuthRoute.Route = {
component: 'self',
meta: {
title: '异常页500',
i18nTitle: 'message.routes.exception.500',
requiresAuth: true,
icon: 'ic:baseline-wifi-off'
}
}
],
meta: {
i18nTitle: 'message.routes.exception._value',
title: '异常页',
icon: 'ant-design:exception-outlined',
order: 7
Expand Down
2 changes: 2 additions & 0 deletions src/router/modules/function.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const functionRoute: AuthRoute.Route = {
component: 'self',
meta: {
title: 'Tab',
i18nTitle: 'message.routes.function.tab',
requiresAuth: true,
icon: 'ic:round-tab'
}
Expand Down Expand Up @@ -41,6 +42,7 @@ const functionRoute: AuthRoute.Route = {
],
meta: {
title: '功能',
i18nTitle: 'message.routes.function._value',
icon: 'icon-park-outline:all-application',
order: 6
}
Expand Down
5 changes: 5 additions & 0 deletions src/router/modules/management.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const management: AuthRoute.Route = {
component: 'self',
meta: {
title: '权限管理',
i18nTitle: 'message.routes.management.auth',
requiresAuth: true,
icon: 'ic:baseline-security'
}
Expand All @@ -19,6 +20,7 @@ const management: AuthRoute.Route = {
component: 'self',
meta: {
title: '角色管理',
i18nTitle: 'message.routes.management.role',
requiresAuth: true,
icon: 'carbon:user-role'
}
Expand All @@ -29,6 +31,7 @@ const management: AuthRoute.Route = {
component: 'self',
meta: {
title: '用户管理',
i18nTitle: 'message.routes.management.user',
requiresAuth: true,
icon: 'ic:round-manage-accounts'
}
Expand All @@ -39,13 +42,15 @@ const management: AuthRoute.Route = {
component: 'self',
meta: {
title: '路由管理',
i18nTitle: 'message.routes.management.route',
requiresAuth: true,
icon: 'material-symbols:route'
}
}
],
meta: {
title: '系统管理',
i18nTitle: 'message.routes.management._value',
icon: 'carbon:cloud-service-management',
order: 9
}
Expand Down
5 changes: 5 additions & 0 deletions src/router/modules/multi-menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const multiMenu: AuthRoute.Route = {
component: 'self',
meta: {
title: '二级菜单',
i18nTitle: 'message.routes.multi-menu.first.second',
requiresAuth: true,
icon: 'mdi:menu'
}
Expand All @@ -29,25 +30,29 @@ const multiMenu: AuthRoute.Route = {
component: 'self',
meta: {
title: '三级菜单',
i18nTitle: 'message.routes.multi-menu.first.second-new.third',
requiresAuth: true,
icon: 'mdi:menu'
}
}
],
meta: {
title: '二级菜单(有子菜单)',
i18nTitle: 'message.routes.multi-menu.first.second-new._value',
icon: 'mdi:menu'
}
}
],
meta: {
title: '一级菜单',
i18nTitle: 'message.routes.multi-menu.first._value',
icon: 'mdi:menu'
}
}
],
meta: {
title: '多级菜单',
i18nTitle: 'message.routes.multi-menu._value',
icon: 'carbon:menu',
order: 8
}
Expand Down
Loading

0 comments on commit f68285f

Please sign in to comment.