Skip to content

Commit 72c37c9

Browse files
committed
feat(ui): update i18n
1 parent f8fbbe4 commit 72c37c9

11 files changed

Lines changed: 124 additions & 37 deletions

File tree

cmdb-ui/src/components/CustomIconSelect/constants.js

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export const commonIconList = ['changyong-ubuntu',
4747
export const linearIconList = [
4848
{
4949
value: 'database',
50-
label: '数据库',
50+
label: 'components.database',
5151
list: [{
5252
value: 'icon-xianxing-DB2',
5353
label: 'DB2'
@@ -81,7 +81,7 @@ export const linearIconList = [
8181
}]
8282
}, {
8383
value: 'system',
84-
label: '操作系统',
84+
label: 'components.system',
8585
list: [{
8686
value: 'icon-xianxing-Windows',
8787
label: 'Windows'
@@ -106,7 +106,7 @@ export const linearIconList = [
106106
}]
107107
}, {
108108
value: 'language',
109-
label: '语言',
109+
label: 'components.language',
110110
list: [{
111111
value: 'icon-xianxing-python',
112112
label: 'python'
@@ -137,7 +137,7 @@ export const linearIconList = [
137137
}]
138138
}, {
139139
value: 'status',
140-
label: '状态',
140+
label: 'components.status',
141141
list: [{
142142
value: 'icon-xianxing-yiwen',
143143
label: '疑问'
@@ -177,7 +177,7 @@ export const linearIconList = [
177177
}]
178178
}, {
179179
value: 'icon-xianxing-application',
180-
label: '常用组件',
180+
label: 'components.commonComponent',
181181
list: [{
182182
value: 'icon-xianxing-yilianjie',
183183
label: '已连接'
@@ -310,7 +310,7 @@ export const linearIconList = [
310310
}]
311311
}, {
312312
value: 'data',
313-
label: '数据',
313+
label: 'components.data',
314314
list: [{
315315
value: 'icon-xianxing-bingzhuangtu',
316316
label: '饼状图'
@@ -387,7 +387,7 @@ export const linearIconList = [
387387
export const fillIconList = [
388388
{
389389
value: 'database',
390-
label: '数据库',
390+
label: 'components.database',
391391
list: [{
392392
value: 'icon-shidi-DB2',
393393
label: 'DB2'
@@ -421,7 +421,7 @@ export const fillIconList = [
421421
}]
422422
}, {
423423
value: 'system',
424-
label: '操作系统',
424+
label: 'components.system',
425425
list: [{
426426
value: 'icon-shidi-Windows',
427427
label: 'Windows'
@@ -446,7 +446,7 @@ export const fillIconList = [
446446
}]
447447
}, {
448448
value: 'language',
449-
label: '语言',
449+
label: 'components.language',
450450
list: [{
451451
value: 'icon-shidi-python',
452452
label: 'python'
@@ -477,7 +477,7 @@ export const fillIconList = [
477477
}]
478478
}, {
479479
value: 'status',
480-
label: '状态',
480+
label: 'components.status',
481481
list: [{
482482
value: 'icon-shidi-yiwen',
483483
label: '疑问'
@@ -517,7 +517,7 @@ export const fillIconList = [
517517
}]
518518
}, {
519519
value: 'icon-shidi-application',
520-
label: '常用组件',
520+
label: 'components.commonComponent',
521521
list: [{
522522
value: 'icon-shidi-yilianjie',
523523
label: '已连接'
@@ -650,7 +650,7 @@ export const fillIconList = [
650650
}]
651651
}, {
652652
value: 'data',
653-
label: '数据',
653+
label: 'components.data',
654654
list: [{
655655
value: 'icon-shidi-bingzhuangtu',
656656
label: '饼状图'
@@ -727,7 +727,7 @@ export const fillIconList = [
727727
export const multicolorIconList = [
728728
{
729729
value: 'database',
730-
label: '数据库',
730+
label: 'components.database',
731731
list: [{
732732
value: 'caise-TIDB',
733733
label: 'TIDB'
@@ -773,7 +773,7 @@ export const multicolorIconList = [
773773
}]
774774
}, {
775775
value: 'cloud',
776-
label: '',
776+
label: 'components.cloud',
777777
list: [{
778778
value: 'AWS',
779779
label: 'AWS'
@@ -819,7 +819,7 @@ export const multicolorIconList = [
819819
}]
820820
}, {
821821
value: 'system',
822-
label: '操作系统',
822+
label: 'components.system',
823823
list: [{
824824
value: 'ciase-aix',
825825
label: 'aix'
@@ -847,7 +847,7 @@ export const multicolorIconList = [
847847
}]
848848
}, {
849849
value: 'language',
850-
label: '语言',
850+
label: 'components.language',
851851
list: [{
852852
value: 'caise-python',
853853
label: 'python'
@@ -878,7 +878,7 @@ export const multicolorIconList = [
878878
}]
879879
}, {
880880
value: 'status',
881-
label: '状态',
881+
label: 'components.status',
882882
list: [{
883883
value: 'caise-yiwen',
884884
label: '疑问'
@@ -918,7 +918,7 @@ export const multicolorIconList = [
918918
}]
919919
}, {
920920
value: 'caise-application',
921-
label: '常用组件',
921+
label: 'components.commonComponent',
922922
list: [{
923923
value: 'caise-websphere',
924924
label: 'WebSphere'
@@ -1180,7 +1180,7 @@ export const multicolorIconList = [
11801180
}]
11811181
}, {
11821182
value: 'data',
1183-
label: '数据',
1183+
label: 'components.data',
11841184
list: [{
11851185
value: 'caise-bingzhuangtu',
11861186
label: '饼状图'

cmdb-ui/src/components/CustomIconSelect/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
<template v-if="iconList && iconList.length">
3434
<template v-if="currentIconType !== '4'">
3535
<div v-for="category in iconList" :key="category.value">
36-
<h4 class="category">{{ category.label }}</h4>
36+
<h4 class="category">{{ $t(category.label) }}</h4>
3737
<div class="custom-icon-select-popover-content-wrapper">
3838
<div
3939
v-for="name in category.list"

cmdb-ui/src/components/Exception/ExceptionPage.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
</div>
77
<div class="content">
88
<h1>{{ config[type].title }}</h1>
9-
<div class="desc">{{ config[type].desc }}</div>
9+
<div class="desc">{{ $t(config[type].desc) }}</div>
1010
<div class="actions">
11-
<a-button type="primary" @click="handleToHome">返回首页</a-button>
11+
<a-button type="primary" @click="handleToHome">{{ $t('exception.backToHome') }}</a-button>
1212
</div>
1313
</div>
1414
</div>

cmdb-ui/src/components/Exception/type.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@ const types = {
22
403: {
33
img: 'https://gw.alipayobjects.com/zos/rmsportal/wZcnGqRDyhPOEYFcZDnb.svg',
44
title: '403',
5-
desc: '抱歉,你无权访问该页面'
5+
desc: 'exception.desc1'
66
},
77
404: {
88
img: 'https://gw.alipayobjects.com/zos/rmsportal/KpnpchXsobRgLElEozzI.svg',
99
title: '404',
10-
desc: '抱歉,你访问的页面不存在或仍在开发中'
10+
desc: 'exception.desc2'
1111
},
1212
500: {
1313
img: 'https://gw.alipayobjects.com/zos/rmsportal/RVRUAYdCGeYNBWoKiIwB.svg',
1414
title: '500',
15-
desc: '抱歉,服务器出错了'
15+
desc: 'exception.desc3'
1616
}
1717
}
1818

cmdb-ui/src/lang/en.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,25 @@ export default {
109109
default: 'default',
110110
tip: 'Tip',
111111
cmdbSearch: 'Search',
112+
exception: {
113+
backToHome: 'Back to home page',
114+
desc1: 'Sorry, you are not authorized to access this page',
115+
desc2: 'Sorry, the page you are visiting does not exist or is still under development',
116+
desc3: 'Sorry, server error'
117+
},
112118
pagination: {
113119
total: '{range0}-{range1} of {total} items'
114120
},
121+
components: {
122+
colorTagSelectTip: 'Enter or select tags',
123+
database: 'Database',
124+
system: 'System',
125+
language: 'Language',
126+
status: 'Status',
127+
commonComponent: 'Common Component',
128+
data: 'Data',
129+
cloud: 'Cloud'
130+
},
115131
topMenu: {
116132
personalCenter: 'My Profile',
117133
logout: 'Logout',

cmdb-ui/src/lang/zh.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,25 @@ export default {
109109
default: '默认',
110110
tip: '提示',
111111
cmdbSearch: '搜索一下',
112+
exception: {
113+
backToHome: '返回首页',
114+
desc1: '抱歉,你无权访问该页面',
115+
desc2: '抱歉,你访问的页面不存在或仍在开发中',
116+
desc3: '抱歉,服务器出错了'
117+
},
112118
pagination: {
113119
total: '当前展示 {range0}-{range1} 条数据, 共 {total} 条'
114120
},
121+
components: {
122+
colorTagSelectTip: '选择或输入(回车确定)标签',
123+
database: '数据库',
124+
system: '操作系统',
125+
language: '语言',
126+
status: '状态',
127+
commonComponent: '常用组件',
128+
data: '数据',
129+
cloud: '云'
130+
},
115131
topMenu: {
116132
personalCenter: '个人中心',
117133
logout: '退出登录',

cmdb-ui/src/utils/util.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import _ from 'lodash'
2+
import i18n from '@/lang'
3+
24
export function timeFix() {
35
const time = new Date()
46
const hour = time.getHours()
5-
return hour < 9 ? '早上好' : hour <= 11 ? '上午好' : hour <= 13 ? '中午好' : hour < 20 ? '下午好' : '晚上好'
7+
return hour < 9 ? i18n.t('cs.login.welcomeTime1') : hour <= 11 ? i18n.t('cs.login.welcomeTime2') : hour <= 13 ? i18n.t('cs.login.welcomeTime3') : hour < 20 ? i18n.t('cs.login.welcomeTime4') : i18n.t('cs.login.welcomeTime5')
68
}
79

810
export function welcome() {

cmdb-ui/src/views/setting/auth/oauth2.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<a-form-model-item :label="$t('cs.auth.oauth2.tokenUrl')" prop="token_url">
2424
<a-input v-model="form.token_url" :placeholder="$t('cs.auth.oauth2.tokenUrlPlaceholder')" />
2525
</a-form-model-item>
26-
<SpanTitle>其他</SpanTitle>
26+
<SpanTitle>{{ $t('cs.auth.other') }}</SpanTitle>
2727
<a-form-model-item :label="$t('cs.auth.oauth2.userInfo')" prop="user_info" :wrapper-col="{ span: 15 }">
2828
<vue-json-editor
2929
:style="{ '--custom-height': `${200}px` }"

cmdb-ui/src/views/setting/lang/en.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,27 @@ const cs_en = {
445445
test: 'Test',
446446
selectApp: 'Select App',
447447
},
448+
login: {
449+
loginText: 'OneOps making operations simple',
450+
username: 'Username/Email',
451+
usernameRequired: 'Please input Username/Email',
452+
password: 'Password',
453+
passwordRequired: 'Please input Password',
454+
captcha: 'Captcha',
455+
captchaRequired: 'Please input Captcha',
456+
loginBtn: 'Login',
457+
autoLogin: 'Auto Login',
458+
otherLoginWay: 'Other Login',
459+
welcomeMessage: 'Welcome',
460+
welcomeDesc: '{name} Welcome Back',
461+
welcomeTime1: 'Good Morning',
462+
welcomeTime2: 'Good Morning',
463+
welcomeTime3: 'Good Afternoon',
464+
welcomeTime4: 'Good Afternoon',
465+
welcomeTime5: 'Good Evening',
466+
oneDeviceLogin: 'Login on one device only',
467+
logoutSoon: 'Logging Out Soon...',
468+
}
448469
}
449470

450471
export default cs_en

cmdb-ui/src/views/setting/lang/zh.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,5 +443,26 @@ const cs_zh = {
443443
test: '测试',
444444
selectApp: '选择应用',
445445
},
446+
login: {
447+
loginText: '维易科技 让运维变简单',
448+
username: '用户名/邮箱',
449+
usernameRequired: '请输入用户名或邮箱',
450+
password: '密码',
451+
passwordRequired: '请输入密码',
452+
captcha: '图片验证码',
453+
captchaRequired: '请输入验证码',
454+
loginBtn: '登录',
455+
autoLogin: '自动登录',
456+
otherLoginWay: '其他登录方式',
457+
welcomeMessage: '欢迎',
458+
welcomeDesc: '{name} 欢迎回来',
459+
welcomeTime1: '早上好',
460+
welcomeTime2: '上午好',
461+
welcomeTime3: '中午好',
462+
welcomeTime4: '下午好',
463+
welcomeTime5: '晚上好',
464+
oneDeviceLogin: '只能在一个设备上登录',
465+
logoutSoon: '即将登出...',
466+
}
446467
}
447468
export default cs_zh

0 commit comments

Comments
 (0)