Skip to content

Commit ac13c6a

Browse files
committed
feat: i18n
1 parent b1cd957 commit ac13c6a

File tree

6 files changed

+132
-26
lines changed

6 files changed

+132
-26
lines changed

ui/src/locales/lang/en-US/views/log.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export default {
2222
recenTimes: 'Recent Conversation Time'
2323
},
2424
addToDataset: 'Add to Knowledge Base',
25-
daysText: 'Conversation records from more than X days ago',
25+
daysText: 'Days ago',
2626
selectDataset: 'Select Knowledge Base',
2727
selectDatasetPlaceholder: 'Please select a knowledge base',
2828
saveToDocument: 'Save to Document',
@@ -35,6 +35,6 @@ export default {
3535
},
3636
title: {
3737
placeholder: 'Please set a title for the current content for management and viewing'
38-
},
38+
}
3939
}
4040
}

ui/src/locales/lang/en-US/views/template.ts

Lines changed: 60 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,21 @@ export default {
66
searchBar: {
77
placeholder: 'Search by name'
88
},
9-
delete: {},
10-
setting: {},
9+
delete: {
10+
confirmTitle: 'Delete Model',
11+
confirmMessage: 'Are you sure you want to delete the model:'
12+
},
13+
tip: {
14+
createSuccessMessage: 'Model created successfully',
15+
createErrorMessage: 'There are errors in the basic information',
16+
errorMessage: 'Variable already exists: ',
17+
emptyMessage1: 'Please select the model type and base model in the basic information first',
18+
emptyMessage2: 'The selected model does not support parameter settings',
19+
updateSuccessMessage: 'Model updated successfully',
20+
saveSuccessMessage: 'Model parameters saved successfully',
21+
downloadError: 'Download failed',
22+
noModel: 'Model does not exist in Ollama'
23+
},
1124
model: {
1225
allModel: 'All Models',
1326
publicModel: 'Public Models',
@@ -22,14 +35,55 @@ export default {
2235
},
2336
templateForm: {
2437
title: {
25-
editParam: 'Edit Parameters',
38+
baseInfo: 'Basic Information',
39+
advancedInfo: 'Advanced Settings',
40+
modelParams: 'Model Parameters',
41+
editParam: 'Edit Parameter',
2642
addParam: 'Add Parameter',
43+
paramSetting: 'Model Parameter Settings',
44+
apiParamPassing: 'API Parameter Passing'
2745
},
2846
form: {
29-
provider: {
30-
label: 'Provider',
31-
placeholder: 'Select Provider'
47+
templateName: {
48+
label: 'Model Name',
49+
placeholder: 'Set a name for the base model',
50+
tooltip: 'Custom model name in MaxKB',
51+
requiredMessage: 'Model name cannot be empty'
52+
},
53+
permissionType: {
54+
label: 'Permission',
55+
privateDesc: 'Only the current user can use',
56+
publicDesc: 'All users can use, but cannot be edited',
57+
requiredMessage: 'Permission cannot be empty'
58+
},
59+
model_type: {
60+
label: 'Model Type',
61+
placeholder: 'Select a model type',
62+
tooltip1:
63+
'Large Language Model: An inference model for AI conversations in the application.',
64+
tooltip2:
65+
'Embedding Model: A model for vectorizing document content in the knowledge base.',
66+
tooltip3: 'Speech-to-Text: A model used for speech recognition in the application.',
67+
tooltip4: 'Text-to-Speech: A model used for text-to-speech in the application.',
68+
tooltip5:
69+
'Reranker Model: A model used to reorder candidate segments when using multi-route recall in advanced orchestration applications.',
70+
tooltip6:
71+
'Image Understanding: A visual model used for image understanding in advanced orchestration applications.',
72+
tooltip7:
73+
'Image Generation: A visual model used for image generation in advanced orchestration applications.',
74+
requiredMessage: 'Model type cannot be empty'
75+
},
76+
base_model: {
77+
label: 'Base Model',
78+
tooltip:
79+
'For models not listed in the list, enter the model name directly and press Enter to add',
80+
placeholder: 'Enter the base model name and press Enter to add',
81+
requiredMessage: 'Base model cannot be empty'
3282
}
3383
}
84+
},
85+
download: {
86+
downloading: 'Downloading...',
87+
cancelDownload: 'Cancel Download'
3488
}
3589
}

ui/src/locales/lang/zh-TW/views/template.ts

Lines changed: 55 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,21 @@ export default {
66
searchBar: {
77
placeholder: '按名稱搜尋'
88
},
9-
delete: {},
10-
setting: {},
9+
delete: {
10+
confirmTitle: '刪除模型',
11+
confirmMessage: '是否刪除模型:'
12+
},
13+
tip: {
14+
createSuccessMessage: '創建模型成功',
15+
createErrorMessage: '基礎資訊有填寫錯誤',
16+
errorMessage: '變數已存在: ',
17+
emptyMessage1: '請先選擇基礎資訊的模型類型和基礎模型',
18+
emptyMessage2: '所選模型不支援參數設定',
19+
updateSuccessMessage: '修改模型成功',
20+
saveSuccessMessage: '模型參數儲存成功',
21+
downloadError: '下載失敗',
22+
noModel: '模型在Ollama不存在'
23+
},
1124
model: {
1225
allModel: '全部模型',
1326
publicModel: '公有模型',
@@ -22,11 +35,49 @@ export default {
2235
},
2336
templateForm: {
2437
title: {
38+
baseInfo: '基礎資訊',
39+
advancedInfo: '進階設定',
40+
modelParams: '模型參數',
2541
editParam: '編輯參數',
26-
addParam: '添加參數',
42+
addParam: '新增參數',
43+
paramSetting: '模型參數設定',
44+
apiParamPassing: '接口傳參'
2745
},
2846
form: {
29-
47+
templateName: {
48+
label: '模型名稱',
49+
placeholder: '請給基礎模型設定一個名稱',
50+
tooltip: 'MaxKB 中自訂的模型名稱',
51+
requiredMessage: '模型名稱不能為空'
52+
},
53+
permissionType: {
54+
label: '權限',
55+
privateDesc: '僅當前使用者使用',
56+
publicDesc: '所有使用者都可使用,但不能編輯',
57+
requiredMessage: '權限不能為空'
58+
},
59+
model_type: {
60+
label: '模型類型',
61+
placeholder: '請選擇模型類型',
62+
tooltip1: '大語言模型:在應用中與AI對話的推理模型。',
63+
tooltip2: '向量模型:在知識庫中對文件內容進行向量化化的模型。',
64+
tooltip3: '語音辨識:在應用中開啟語音辨識後用於語音轉文字的模型。',
65+
tooltip4: '語音合成:在應用中開啟語音播放後用於文字轉語音的模型。',
66+
tooltip5: '重排模型:在高階編排應用中使用多路召回時,對候選分段進行重新排序的模型。',
67+
tooltip6: '圖片理解:在高階編排應用中用於圖片理解的視覺模型。',
68+
tooltip7: '圖片生成:在高階編排應用中用於圖片生成的視覺模型。',
69+
requiredMessage: '模型類型不能為空'
70+
},
71+
base_model: {
72+
label: '基礎模型',
73+
tooltip: '列表中未列出的模型,直接輸入模型名稱,按 Enter 即可新增',
74+
placeholder: '自訂輸入基礎模型後按 Enter 即可',
75+
requiredMessage: '基礎模型不能為空'
76+
}
3077
}
78+
},
79+
download: {
80+
downloading: '正在下載中',
81+
cancelDownload: '取消下載'
3182
}
3283
}

ui/src/router/modules/application.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import Layout from '@/layout/layout-template/DetailLayout.vue'
22
import { ComplexPermission } from '@/utils/permission/type'
3+
import { t } from '@/locales'
4+
35
const applicationRouter = {
46
path: '/application',
57
name: 'application',
@@ -26,7 +28,7 @@ const applicationRouter = {
2628
meta: {
2729
icon: 'app-all-menu',
2830
iconActive: 'app-all-menu-active',
29-
title: '概览',
31+
title: t('views.applicationOverview.title'),
3032
active: 'overview',
3133
parentPath: '/application/:id/:type',
3234
parentName: 'ApplicationDetail'
@@ -39,7 +41,7 @@ const applicationRouter = {
3941
meta: {
4042
icon: 'app-setting',
4143
iconActive: 'app-setting-active',
42-
title: '设置',
44+
title: t('common.setting'),
4345
active: 'setting',
4446
parentPath: '/application/:id/:type',
4547
parentName: 'ApplicationDetail'
@@ -52,7 +54,7 @@ const applicationRouter = {
5254
meta: {
5355
icon: 'app-access',
5456
iconActive: 'app-access-active',
55-
title: '应用接入',
57+
title: t('views.application.applicationAccess.title'),
5658
active: 'access',
5759
parentPath: '/application/:id/:type',
5860
parentName: 'ApplicationDetail',
@@ -65,7 +67,7 @@ const applicationRouter = {
6567
name: 'AppHitTest',
6668
meta: {
6769
icon: 'app-hit-test',
68-
title: '命中测试',
70+
title: t('views.application.hitTest.title'),
6971
active: 'hit-test',
7072
parentPath: '/application/:id/:type',
7173
parentName: 'ApplicationDetail'
@@ -78,7 +80,7 @@ const applicationRouter = {
7880
meta: {
7981
icon: 'app-document',
8082
iconActive: 'app-document-active',
81-
title: '对话日志',
83+
title: t('views.log.title'),
8284
active: 'log',
8385
parentPath: '/application/:id/:type',
8486
parentName: 'ApplicationDetail'

ui/src/router/modules/dataset.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import Layout from '@/layout/layout-template/DetailLayout.vue'
2+
import { t } from '@/locales'
23
const datasetRouter = {
34
path: '/dataset',
45
name: 'dataset',
@@ -32,7 +33,7 @@ const datasetRouter = {
3233
meta: {
3334
icon: 'app-document',
3435
iconActive: 'app-document-active',
35-
title: '文档',
36+
title: t('common.fileUpload.document'),
3637
active: 'document',
3738
parentPath: '/dataset/:id',
3839
parentName: 'DatasetDetail'
@@ -45,7 +46,7 @@ const datasetRouter = {
4546
meta: {
4647
icon: 'app-problems',
4748
iconActive: 'QuestionFilled',
48-
title: '问题',
49+
title: t('views.problem.title'),
4950
active: 'problem',
5051
parentPath: '/dataset/:id',
5152
parentName: 'DatasetDetail'
@@ -57,7 +58,7 @@ const datasetRouter = {
5758
name: 'DatasetHitTest',
5859
meta: {
5960
icon: 'app-hit-test',
60-
title: '命中测试',
61+
title: t('views.application.hitTest.title'),
6162
active: 'hit-test',
6263
parentPath: '/dataset/:id',
6364
parentName: 'DatasetDetail'
@@ -70,7 +71,7 @@ const datasetRouter = {
7071
meta: {
7172
icon: 'app-setting',
7273
iconActive: 'app-setting-active',
73-
title: '设置',
74+
title: t('common.setting'),
7475
active: 'setting',
7576
parentPath: '/dataset/:id',
7677
parentName: 'DatasetDetail'

ui/src/views/log/index.vue

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -183,14 +183,12 @@
183183
step-strictly
184184
style="width: 110px; margin-left: 8px; margin-right: 8px"
185185
></el-input-number>
186-
<span>{{ $t('views.log.form.daysText') }}</span>
186+
<span>{{ $t('views.log.daysText') }}</span>
187187
<template #footer>
188188
<div class="dialog-footer" style="margin-top: 16px">
189-
<el-button @click="dialogVisible = false"
190-
>{{ $t('layout.avatar.dialog.cancel') }}
191-
</el-button>
189+
<el-button @click="dialogVisible = false">{{ $t('common.cancel') }} </el-button>
192190
<el-button type="primary" @click="saveCleanTime">
193-
{{ $t('layout.avatar.dialog.save') }}
191+
{{ $t('common.save') }}
194192
</el-button>
195193
</div>
196194
</template>

0 commit comments

Comments
 (0)