Skip to content

Commit 65896cf

Browse files
committed
feat: i18n
1 parent 0959b2a commit 65896cf

File tree

13 files changed

+462
-158
lines changed

13 files changed

+462
-158
lines changed

ui/src/locales/lang/en_US/views/system.ts

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,45 @@ export default {
8989
}
9090
},
9191
theme: {
92-
title: 'Appearance Settings'
92+
title: 'Appearance Settings',
93+
platformDisplayTheme: 'Platform Display Theme',
94+
customTheme: 'Custom Theme',
95+
platformLoginSettings: 'Platform Login Settings',
96+
custom: 'Custom',
97+
pagePreview: 'Page Preview',
98+
default: 'Default',
99+
restoreDefaults: 'Restore Defaults',
100+
orange: 'Orange',
101+
green: 'Green',
102+
purple: 'Purple',
103+
red: 'Red',
104+
loginBackground: 'Login Background Image',
105+
loginLogo: 'Login Logo',
106+
websiteLogo: 'Website Logo',
107+
replacePicture: 'Replace Image',
108+
websiteLogoTip:
109+
'Logo displayed at the top of the website. Recommended size: 48x48. Supports JPG, PNG, GIF. Maximum size: 10MB',
110+
loginLogoTip:
111+
'Logo on the right side of the login page. Recommended size: 204x52. Supports JPG, PNG, GIF. Maximum size: 10MB',
112+
loginBackgroundTip:
113+
'Left-side background image. Vector graphics recommended size: 576x900; Bitmap recommended size: 1152x1800. Supports JPG, PNG, GIF. Maximum size: 10MB',
114+
websiteName: 'Website Name',
115+
websiteNamePlaceholder: 'Please enter the website name',
116+
websiteNameTip: 'The platform name displayed in the web page tab',
117+
websiteSlogan: 'Welcome Message',
118+
websiteSloganPlaceholder: 'Please enter the welcome message',
119+
websiteSloganTip: 'The welcome message below the product logo',
120+
defaultSlogan: 'Welcome to MaxKB Intelligent Knowledge Base Q&A System',
121+
defaultTip: 'Default is the MaxKB login interface, supports custom settings',
122+
platformSetting: 'Platform Settings',
123+
showUserManual: 'Show User Manual',
124+
showForum: 'Show Forum Support',
125+
showProject: 'Show Project Address',
126+
urlPlaceholder: 'Please enter the URL address',
127+
abandonUpdate: 'Abandon Update',
128+
saveAndApply: 'Save and Apply',
129+
fileMessageError: 'File size exceeds 10MB',
130+
saveSuccess: 'Appearance settings successfully applied'
93131
},
94132
email: {
95133
title: 'Email Setting'

ui/src/locales/lang/zh_CN/views/system.ts

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,43 @@ export default {
8989
}
9090
},
9191
theme: {
92-
title: '外观设置'
92+
title: '外观设置',
93+
platformDisplayTheme: '平台显示主题',
94+
customTheme: '自定义主题',
95+
platformLoginSettings: '平台登录设置',
96+
custom: '自定义',
97+
pagePreview: '页面预览',
98+
default: '默认',
99+
restoreDefaults: '恢复默认',
100+
orange: '活力橙',
101+
green: '松石绿',
102+
purple: '神秘紫',
103+
red: '胭脂红',
104+
loginBackground: '登录背景图',
105+
loginLogo: '登录 Logo',
106+
websiteLogo: '网站 Logo',
107+
replacePicture: '替换图片',
108+
websiteLogoTip: '顶部网站显示的 Logo,建议尺寸 48*48,支持 JPG、PNG、GIF,大小不超过 10MB',
109+
loginLogoTip: '登录页面右侧 Logo,建议尺寸 204*52,支持 JPG、PNG、GIF,大小不超过 10 MB',
110+
loginBackgroundTip:
111+
'左侧背景图,矢量图建议尺寸 576*900,位图建议尺寸 1152*1800;支持 JPG、PNG、GIF,大小不超过 10 MB',
112+
websiteName: '网站名称',
113+
websiteNamePlaceholder: '请输入网站名称',
114+
websiteNameTip: '显示在网页 Tab 的平台名称',
115+
websiteSlogan: '欢迎语',
116+
websiteSloganPlaceholder: '请输入欢迎语',
117+
websiteSloganTip: '产品 Logo 下的欢迎语',
118+
defaultSlogan: '欢迎使用 MaxKB 智能知识库问答系统',
119+
defaultTip: '默认为 MaxKB 登录界面,支持自定义设置',
120+
platformSetting: '平台设置',
121+
showUserManual: '显示用户手册',
122+
showForum: '显示论坛求助',
123+
showProject: '显示项目地址',
124+
urlPlaceholder: '请输入 URL 地址',
125+
abandonUpdate: '放弃更新',
126+
saveAndApply: '保存并应用',
127+
fileMessageError: '文件大小超过 10M',
128+
saveSuccess: '外观设置成功'
93129
},
94130
email: {
95131
title: '邮箱配置'

ui/src/locales/lang/zh_TW/views/system.ts

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,43 @@ export default {
9090
}
9191
},
9292
theme: {
93-
title: '外觀設置'
93+
title: '外觀設置',
94+
platformDisplayTheme: '平台顯示主題',
95+
customTheme: '自定義主題',
96+
platformLoginSettings: '平台登錄設置',
97+
custom: '自定義',
98+
pagePreview: '頁面預覽',
99+
default: '默認',
100+
restoreDefaults: '恢復默認',
101+
orange: '活力橙',
102+
green: '松石綠',
103+
purple: '神秘紫',
104+
red: '胭脂紅',
105+
loginBackground: '登錄背景圖',
106+
loginLogo: '登錄 Logo',
107+
websiteLogo: '網站 Logo',
108+
replacePicture: '替換圖片',
109+
websiteLogoTip: '頂部網站顯示的 Logo,建議尺寸 48*48,支持 JPG、PNG、GIF,大小不超過 10MB',
110+
loginLogoTip: '登錄頁面右側 Logo,建議尺寸 204*52,支持 JPG、PNG、GIF,大小不超過 10 MB',
111+
loginBackgroundTip:
112+
'左側背景圖,矢量圖建議尺寸 576*900,位圖建議尺寸 1152*1800;支持 JPG、PNG、GIF,大小不超過 10 MB',
113+
websiteName: '網站名稱',
114+
websiteNamePlaceholder: '請輸入網站名稱',
115+
websiteNameTip: '顯示在網頁 Tab 的平台名稱',
116+
websiteSlogan: '歡迎語',
117+
websiteSloganPlaceholder: '請輸入歡迎語',
118+
websiteSloganTip: '產品 Logo 下的歡迎語',
119+
defaultSlogan: '歡迎使用 MaxKB 智能知識庫問答系統',
120+
defaultTip: '默認為 MaxKB 登錄界面,支持自定義設置',
121+
platformSetting: '平台設置',
122+
showUserManual: '顯示用戶手冊',
123+
showForum: '顯示論壇求助',
124+
showProject: '顯示項目地址',
125+
urlPlaceholder: '請輸入 URL 地址',
126+
abandonUpdate: '放棄更新',
127+
saveAndApply: '保存並應用',
128+
fileMessageError: '文件大小超過 10M',
129+
saveSuccess: '外觀設置成功'
94130
},
95131
email: {
96132
title: '郵箱配置'

ui/src/utils/theme.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,28 @@
1+
import { t } from '@/locales'
2+
13
export const themeList = [
24
{
3-
label: '默认',
5+
label: t('views.system.theme.default'),
46
value: '#3370FF',
57
loginBackground: 'default'
68
},
79
{
8-
label: '活力橙',
10+
label: t('views.system.theme.orange'),
911
value: '#FF8800',
1012
loginBackground: 'orange'
1113
},
1214
{
13-
label: '松石绿',
15+
label: t('views.system.theme.green'),
1416
value: '#00B69D',
1517
loginBackground: 'green'
1618
},
1719
{
18-
label: '神秘紫',
20+
label: t('views.system.theme.purple'),
1921
value: '#7F3BF5',
2022
loginBackground: 'purple'
2123
},
2224
{
23-
label: '胭脂红',
25+
label: t('views.system.theme.red'),
2426
value: '#F01D94',
2527
loginBackground: 'red'
2628
}
@@ -35,7 +37,7 @@ export const defaultSetting = {
3537
loginLogo: '',
3638
loginImage: '',
3739
title: 'MaxKB',
38-
slogan: '欢迎使用 MaxKB 智能知识库问答系统'
40+
slogan: t('views.system.theme.defaultSlogan')
3941
}
4042

4143
export const defaultPlatformSetting = {

ui/src/views/authentication/component/CAS.vue

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,36 @@
99
label-position="top"
1010
require-asterisk-position="right"
1111
>
12-
<el-form-item :label="$t('system.authentication.cas.ldpUri')" prop="config_data.ldpUri">
12+
<el-form-item
13+
:label="$t('views.system.authentication.cas.ldpUri')"
14+
prop="config_data.ldpUri"
15+
>
1316
<el-input
1417
v-model="form.config_data.ldpUri"
15-
:placeholder="$t('system.authentication.cas.ldpUriPlaceholder')"
18+
:placeholder="$t('views.system.authentication.cas.ldpUriPlaceholder')"
1619
/>
1720
</el-form-item>
18-
<el-form-item :label="$t('system.authentication.cas.validateUrl')" prop="config_data.validateUrl">
21+
<el-form-item
22+
:label="$t('views.system.authentication.cas.validateUrl')"
23+
prop="config_data.validateUrl"
24+
>
1925
<el-input
2026
v-model="form.config_data.validateUrl"
21-
:placeholder="$t('system.authentication.cas.validateUrlPlaceholder')"
27+
:placeholder="$t('views.system.authentication.cas.validateUrlPlaceholder')"
2228
/>
2329
</el-form-item>
24-
<el-form-item :label="$t('system.authentication.cas.redirectUrl')" prop="config_data.redirectUrl">
30+
<el-form-item
31+
:label="$t('views.system.authentication.cas.redirectUrl')"
32+
prop="config_data.redirectUrl"
33+
>
2534
<el-input
2635
v-model="form.config_data.redirectUrl"
27-
:placeholder="$t('system.authentication.cas.redirectUrlPlaceholder')"
36+
:placeholder="$t('views.system.authentication.cas.redirectUrlPlaceholder')"
2837
/>
2938
</el-form-item>
3039
<el-form-item>
3140
<el-checkbox v-model="form.is_active"
32-
>{{ $t('system.authentication.cas.enableAuthentication') }}
41+
>{{ $t('views.system.authentication.cas.enableAuthentication') }}
3342
</el-checkbox>
3443
</el-form-item>
3544
</el-form>
@@ -67,15 +76,23 @@ const loading = ref(false)
6776
6877
const rules = reactive<FormRules<any>>({
6978
'config_data.ldpUri': [
70-
{ required: true, message: t('system.authentication.cas.ldpUriPlaceholder'), trigger: 'blur' }
79+
{
80+
required: true,
81+
message: t('views.system.authentication.cas.ldpUriPlaceholder'),
82+
trigger: 'blur'
83+
}
7184
],
7285
'config_data.validateUrl': [
73-
{ required: true, message: t('system.authentication.cas.validateUrlPlaceholder'), trigger: 'blur' }
86+
{
87+
required: true,
88+
message: t('views.system.authentication.cas.validateUrlPlaceholder'),
89+
trigger: 'blur'
90+
}
7491
],
7592
'config_data.redirectUrl': [
7693
{
7794
required: true,
78-
message: t('system.authentication.cas.redirectUrlPlaceholder'),
95+
message: t('views.system.authentication.cas.redirectUrlPlaceholder'),
7996
trigger: 'blur'
8097
}
8198
]

ui/src/views/authentication/component/EditModal.vue

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ template
3838
<template #footer>
3939
<span class="dialog-footer">
4040
<el-button @click="handleClose">{{ $t('common.cancel') }}</el-button>
41-
<el-button @click="validateConnection">{{ $t('system.authentication.scanTheQRCode.validate') }}</el-button>
41+
<el-button @click="validateConnection">{{
42+
$t('views.system.authentication.scanTheQRCode.validate')
43+
}}</el-button>
4244
<el-button type="primary" @click="validateForm">{{ $t('common.save') }}</el-button>
4345
</span>
4446
</template>
@@ -98,31 +100,31 @@ const getValidationRules = (key: any) => {
98100
return [
99101
{
100102
required: true,
101-
message: t('system.authentication.scanTheQRCode.appKeyPlaceholder'),
103+
message: t('views.system.authentication.scanTheQRCode.appKeyPlaceholder'),
102104
trigger: ['blur', 'change']
103105
}
104106
]
105107
case 'app_secret':
106108
return [
107109
{
108110
required: true,
109-
message: t('system.authentication.scanTheQRCode.appSecretPlaceholder'),
111+
message: t('views.system.authentication.scanTheQRCode.appSecretPlaceholder'),
110112
trigger: ['blur', 'change']
111113
}
112114
]
113115
case 'corp_id':
114116
return [
115117
{
116118
required: true,
117-
message: t('system.authentication.scanTheQRCode.corpIdPlaceholder'),
119+
message: t('views.system.authentication.scanTheQRCode.corpIdPlaceholder'),
118120
trigger: ['blur', 'change']
119121
}
120122
]
121123
case 'agent_id':
122124
return [
123125
{
124126
required: true,
125-
message: t('system.authentication.scanTheQRCode.agentIdPlaceholder'),
127+
message: t('views.system.authentication.scanTheQRCode.agentIdPlaceholder'),
126128
trigger: ['blur', 'change']
127129
}
128130
]
@@ -135,7 +137,7 @@ const getValidationRules = (key: any) => {
135137
},
136138
{
137139
pattern: /^https?:\/\/.+/,
138-
message: t('system.authentication.scanTheQRCode.callbackWarning'),
140+
message: t('views.system.authentication.scanTheQRCode.callbackWarning'),
139141
trigger: ['blur', 'change']
140142
}
141143
]
@@ -186,7 +188,7 @@ const validateForm = () => {
186188
if (valid) {
187189
saveConfig()
188190
} else {
189-
MsgError(t('system.authentication.scanTheQRCode.validateFailedTip'))
191+
MsgError(t('views.system.authentication.scanTheQRCode.validateFailedTip'))
190192
}
191193
})
192194
}
@@ -200,9 +202,9 @@ const handleClose = () => {
200202
function validateConnection() {
201203
platformApi.validateConnection(currentPlatform, loading).then((res: any) => {
202204
if (res.data) {
203-
MsgSuccess(t('system.authentication.scanTheQRCode.validateSuccess'))
205+
MsgSuccess(t('views.system.authentication.scanTheQRCode.validateSuccess'))
204206
} else {
205-
MsgError(t('system.authentication.scanTheQRCode.validateFailed'))
207+
MsgError(t('views.system.authentication.scanTheQRCode.validateFailed'))
206208
}
207209
})
208210
}

0 commit comments

Comments
 (0)