Skip to content

Commit 39d4ebc

Browse files
perf: Optimize translation
1 parent d39a27f commit 39d4ebc

File tree

10 files changed

+123
-103
lines changed

10 files changed

+123
-103
lines changed

ui/src/components/ai-chat/component/knowledge-source-component/ExecutionDetailCard.vue

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1114,7 +1114,9 @@
11141114
</div>
11151115
<div class="card-never border-r-6 mt-8">
11161116
<h5 class="p-8-12">
1117-
{{ $t('common.param.outputParam') }}({{ $t('chat.executionDetails.documentSplitTip') }})
1117+
{{ $t('common.param.outputParam') }}({{
1118+
$t('chat.executionDetails.documentSplitTip')
1119+
}})
11181120
</h5>
11191121
<div class="p-8-12 border-t-dashed lighter">
11201122
<el-radio-group v-model="currentParagraph" class="app-radio-button-group mb-8">
@@ -1150,12 +1152,14 @@
11501152
{{ $t('common.param.inputParam') }}
11511153
</h5>
11521154
<div class="p-8-12 border-t-dashed lighter">
1153-
<span class="color-secondary">{{$t('chat.executionDetails.subBlockLength')}}:</span>
1155+
<span class="color-secondary"
1156+
>{{ $t('views.workflow.nodes.documentSplitNode.chunk_length.label') }}:</span
1157+
>
11541158
{{ data.size }}
11551159
</div>
11561160
</div>
11571161
<div class="card-never border-r-6 mt-8">
1158-
<h5 class="p-8-12">{{$t('chat.executionDetails.writeContent')}}</h5>
1162+
<h5 class="p-8-12">{{ $t('chat.executionDetails.writeContent') }}</h5>
11591163
<div class="p-8-12 border-t-dashed lighter">
11601164
<el-radio-group v-model="currentWriteContent" class="app-radio-button-group mb-8">
11611165
<template

ui/src/locales/lang/en-US/ai-chat.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ export default {
108108
knowedMessage: 'Known Information',
109109
documentSplitTip: 'Each document can preview only the first five segments',
110110
paragraphRules: 'Segmentation Rules',
111-
subBlockLength: 'Sub-block Length',
112111
writeContent: 'Content Written',
113112
},
114113
KnowledgeSource: {

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

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ export default {
8181
},
8282
nodes: {
8383
knowledgeWriteNode: {
84-
chunk_length: 'Chunk length',
8584
text: 'Knowledge write',
8685
label: 'Knowledge write',
8786
},
@@ -94,6 +93,16 @@ export default {
9493
label: 'Local File',
9594
text: 'Local File',
9695
fileList: 'File List',
96+
fileFormat: {
97+
label: 'Supported File Formats',
98+
requiredMessage: 'Please select file formats',
99+
},
100+
maxFileNumber: {
101+
label: 'Maximum Number of Files per Upload',
102+
},
103+
maxFileCountNumber: {
104+
label: 'Maximum Size per File (MB)',
105+
},
97106
},
98107
classify: {
99108
aiCapability: 'AI capability',
@@ -265,6 +274,16 @@ You are a master of problem optimization, adept at accurately inferring user int
265274
placeholder: 'Please select a splitting strategy',
266275
requiredMessage: 'Please select a splitting strategy',
267276
},
277+
chunk_length: {
278+
label: 'Chunk length',
279+
tooltip1: 'Core objective is to balance retrieval precision and recall efficiency',
280+
tooltip2:
281+
'Avoid excessively short segmentation: A single segment <50 characters may lead to semantic fragmentation, potentially failing to match query intent during retrieval due to lack of context.',
282+
tooltip3:
283+
'Avoid excessive segmentation: A single block exceeding 500 characters increases redundant information, reduces retrieval accuracy, and consumes more storage and computing resources.',
284+
},
285+
title1: 'Segment title set as the associated question of the segment',
286+
title2: 'Document name set as the associated question of the segment',
268287
},
269288
imageUnderstandNode: {
270289
label: 'Image Understanding',
@@ -410,7 +429,6 @@ You are a master of problem optimization, adept at accurately inferring user int
410429
placeholder: 'Please choose a classification option',
411430
classify: {
412431
label: 'Intent classify',
413-
placeholder: 'Please input',
414432
},
415433
input: {
416434
label: 'Input',

ui/src/locales/lang/zh-CN/ai-chat.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ export default {
106106
knowedMessage: '已知信息',
107107
documentSplitTip: '每个文档仅能预览前五个分段',
108108
paragraphRules: '分段规则',
109-
subBlockLength: '子分块长度',
110109
writeContent: '写入内容',
111110
},
112111
KnowledgeSource: {

ui/src/locales/lang/zh-CN/views/workflow.ts

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import tool from '@/api/tool/tool'
2+
import type { title } from 'process'
3+
14
export default {
25
node: '节点',
36
nodeName: '节点名称',
@@ -82,7 +85,6 @@ export default {
8285
},
8386
nodes: {
8487
knowledgeWriteNode: {
85-
chunk_length: '子分块长度',
8688
text: '知识库写入',
8789
label: '知识库写入',
8890
},
@@ -95,6 +97,16 @@ export default {
9597
label: '本地文件',
9698
text: '本地文件',
9799
fileList: '文件列表',
100+
fileFormat: {
101+
label: '支持的文件格式',
102+
requiredMessage: '请选择文件格式',
103+
},
104+
maxFileNumber: {
105+
label: '每次上传最大文件数',
106+
},
107+
maxFileCountNumber: {
108+
label: '上传的每个文档最大(MB)',
109+
},
98110
},
99111
classify: {
100112
aiCapability: 'AI能力',
@@ -270,6 +282,16 @@ export default {
270282
placeholder: '请选择分段策略',
271283
requiredMessage: '请选择分段策略',
272284
},
285+
chunk_length: {
286+
label: '子分块长度',
287+
tooltip1: '核心目标是平衡检索精度与召回效率',
288+
tooltip2:
289+
'避免过短拆分:单块<50 字易导致语义碎片化,检索时可能因缺少上下文无法匹配查询意图',
290+
tooltip3:
291+
'避免过长拆分:单块>500 字会增加冗余信息,降低检索精准度,且占用更多存储和计算资源',
292+
},
293+
title1: '分段标题设置为分段的关联问题',
294+
title2: '文档名称设置为分段的关联问题',
273295
},
274296
imageUnderstandNode: {
275297
label: '图片理解',
@@ -421,7 +443,6 @@ export default {
421443
placeholder: '请选择分类项',
422444
classify: {
423445
label: '意图分类',
424-
placeholder: '请输入',
425446
},
426447
input: {
427448
label: '输入',

ui/src/locales/lang/zh-Hant/ai-chat.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ export default {
106106
knowedMessage: '已知資訊',
107107
documentSplitTip: '每個文件僅能預覽前五個段落',
108108
paragraphRules: '分段規則',
109-
subBlockLength: '子分塊長度',
110109
writeContent: '寫入內容',
111110
},
112111
KnowledgeSource: {

ui/src/locales/lang/zh-Hant/views/workflow.ts

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ export default {
8181
},
8282
nodes: {
8383
knowledgeWriteNode: {
84-
chunk_length: '子分塊長度',
8584
text: '知識庫寫入',
8685
label: '知識庫寫入',
8786
},
@@ -94,6 +93,16 @@ export default {
9493
label: '本地文件',
9594
text: '本地文件',
9695
fileList: '文件列表',
96+
fileFormat: {
97+
label: '支持的文件格式',
98+
requiredMessage: '請選擇文件格式',
99+
},
100+
maxFileNumber: {
101+
label: '每次上傳最大文件數',
102+
},
103+
maxFileCountNumber: {
104+
label: '上傳的每個文檔最大(MB)',
105+
},
97106
},
98107
classify: {
99108
aiCapability: 'AI能力',
@@ -264,6 +273,16 @@ export default {
264273
placeholder: '請選擇分段策略',
265274
requiredMessage: '請選擇分段策略',
266275
},
276+
chunk_length: {
277+
label: '子分塊長度',
278+
tooltip1: '核心目標是平衡檢索精度與召回效率',
279+
tooltip2:
280+
'避免過短拆分:單塊<50 字易導致語義碎片化,檢索時可能因缺少上下文無法匹配查詢意圖',
281+
tooltip3:
282+
'避免過長拆分:單塊>500 字會增加冗餘信息,降低檢索精准度,且佔用更多存儲和計算資源',
283+
},
284+
title1: '分段標題設置為分段的關聯問題',
285+
title2: '文檔名稱設置為分段的關聯問題',
267286
},
268287
imageUnderstandNode: {
269288
label: '圖片理解',
@@ -402,7 +421,6 @@ export default {
402421
placeholder: '請選擇分類項',
403422
classify: {
404423
label: '意圖分類',
405-
placeholder: '請輸入',
406424
},
407425
input: {
408426
label: '輸入',
@@ -438,13 +456,13 @@ export default {
438456
loopIndex: '下標',
439457
loopItem: '循環元素',
440458
},
441-
loopBodyNode: {label: '循環體', text: '循環體'},
459+
loopBodyNode: { label: '循環體', text: '循環體' },
442460
loopContinueNode: {
443461
label: 'Continue',
444462
text: '用於終止當前循環,執行下次循環',
445463
isContinue: 'Continue',
446464
},
447-
loopBreakNode: {label: 'Break', text: '終止當前循環,跳出循環體', isBreak: 'Break'},
465+
loopBreakNode: { label: 'Break', text: '終止當前循環,跳出循環體', isBreak: 'Break' },
448466
variableSplittingNode: {
449467
label: '變量拆分',
450468
text: '通過配置 JSON Path 表達式,對輸入的 JSON 格式變量進行解析和拆分',

ui/src/workflow/nodes/data-source-local-node/index.vue

Lines changed: 7 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,17 @@
1010
label-width="auto"
1111
>
1212
<el-form-item
13-
:label="$t('views.workflow.nodes.dataSourceLocalNode.fileFormat.label', '支持的文件格式')"
13+
:label="$t('views.workflow.nodes.dataSourceLocalNode.fileFormat.label')"
1414
:rules="{
1515
type: 'array',
1616
required: true,
17-
message: $t(
18-
'views.workflow.nodes.dataSourceLocalNode.fileFormat.message',
19-
'请选择文件格式',
20-
),
17+
message: $t('views.workflow.nodes.dataSourceLocalNode.fileFormat.requiredMessage'),
2118
trigger: 'change',
2219
}"
2320
>
2421
<el-select
2522
v-model="form_data.file_type_list"
26-
:placeholder="
27-
$t(
28-
'views.workflow.nodes.dataSourceLocalNode.fileFormat.placeholder',
29-
'请选择文件格式',
30-
)
31-
"
23+
:placeholder="$t('views.workflow.nodes.dataSourceLocalNode.fileFormat.requiredMessage')"
3224
class="w-240"
3325
clearable
3426
multiple
@@ -48,16 +40,11 @@
4840
</el-select>
4941
</el-form-item>
5042
<el-form-item
51-
:label="
52-
$t('views.workflow.nodes.dataSourceLocalNode.maxFileNumber.label', '每次上传最大文件数')
53-
"
43+
:label="$t('views.workflow.nodes.dataSourceLocalNode.maxFileNumber.label')"
5444
:rules="{
5545
type: 'array',
5646
required: true,
57-
message: $t(
58-
'views.workflow.nodes.dataSourceLocalNode.maxFileNumber.placeholder',
59-
'请输入最大文件数',
60-
),
47+
message: $t('common.inputPlaceholder'),
6148
trigger: 'change',
6249
}"
6350
>
@@ -73,19 +60,11 @@
7360
/>
7461
</el-form-item>
7562
<el-form-item
76-
:label="
77-
$t(
78-
'views.workflow.nodes.dataSourceLocalNode.maxFileNumber.label',
79-
'上传的每个文档最大(MB)',
80-
)
81-
"
63+
:label="$t('views.workflow.nodes.dataSourceLocalNode.maxFileCountNumber.label')"
8264
:rules="{
8365
type: 'array',
8466
required: true,
85-
message: $t(
86-
'views.workflow.nodes.dataSourceLocalNode.maxFileNumber.placeholder',
87-
'上传的每个文档最大(MB) 必填',
88-
),
67+
message: $t('common.inputPlaceholder'),
8968
trigger: 'change',
9069
}"
9170
>

0 commit comments

Comments
 (0)