Skip to content

Commit ff3f511

Browse files
author
王丹
committed
feat: i18n
1 parent 5c4d61c commit ff3f511

File tree

18 files changed

+333
-130
lines changed

18 files changed

+333
-130
lines changed

ui/src/components/ai-chat/ExecutionDetailDialog.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<el-dialog
33
class="execution-details-dialog"
4-
title="执行详情"
4+
:title="$t('components.chat.executionDetails.title')"
55
v-model="dialogVisible"
66
destroy-on-close
77
append-to-body
@@ -56,7 +56,9 @@
5656
"
5757
>
5858
<div class="card-never border-r-4">
59-
<h5 class="p-8-12">参数输入</h5>
59+
<h5 class="p-8-12">
60+
{{ $t('components.chat.executionDetails.paramInput') }}
61+
</h5>
6062
<div class="p-8-12 border-t-dashed lighter">
6163
<div class="mb-8">
6264
<span class="color-secondary">用户问题:</span>

ui/src/components/ai-chat/index.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ import ChatInputOperate from '@/components/ai-chat/component/chat-input-operate/
6565
import PrologueContent from '@/components/ai-chat/component/prologue-content/index.vue'
6666
import UserForm from '@/components/ai-chat/component/user-form/index.vue'
6767
import Control from '@/components/ai-chat/component/control/index.vue'
68+
import { t } from '@/locales'
6869
defineOptions({ name: 'AiChat' })
6970
const route = useRoute()
7071
const {
@@ -270,7 +271,7 @@ const getWrite = (chat: any, reader: any, stream: boolean) => {
270271
const errorWrite = (chat: any, message?: string) => {
271272
ChatManagement.addChatRecord(chat, 50, loading)
272273
ChatManagement.write(chat.id)
273-
ChatManagement.append(chat.id, message || '抱歉,当前正在维护,无法提供服务,请稍后再试!')
274+
ChatManagement.append(chat.id, message || t('components.chat.tip.error500Message'))
274275
ChatManagement.updateStatus(chat.id, 500)
275276
ChatManagement.close(chat.id)
276277
}
@@ -343,9 +344,9 @@ function chatMessage(chat?: any, problem?: string, re_chat?: boolean, other_para
343344
errorWrite(chat)
344345
})
345346
} else if (response.status === 460) {
346-
return Promise.reject('无法识别用户身份')
347+
return Promise.reject(t('components.chat.tip.errorIdentifyMessage'))
347348
} else if (response.status === 461) {
348-
return Promise.reject('抱歉,您的提问已达到最大限制,请明天再来吧!')
349+
return Promise.reject('components.chat.tip.errorLimitMessage')
349350
} else {
350351
nextTick(() => {
351352
// 将滚动条滚动到最下面

ui/src/locales/lang/en_US/common.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ export default {
3939
debug: 'Debug',
4040
required: 'Required',
4141
noData: 'No data',
42+
result: 'Result',
4243
status: {
4344
label: 'Status',
4445
enableSuccess: 'Enable Successful',

ui/src/locales/lang/en_US/views/function-lib.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ export default {
6767
paramInfo1: 'Displayed when using the function',
6868
paramInfo2: 'Not displayed when using the function',
6969
code: 'Code',
70-
result: 'Result'
7170
},
7271
debug: {
7372
run: 'Run',

ui/src/locales/lang/zh_CN/common.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ export default {
3939
debug: '调试',
4040
required: '必填',
4141
noData: '暂无数据',
42+
result: '结果',
4243
status: {
4344
label: '状态',
4445
enableSuccess: '启用成功',

ui/src/locales/lang/zh_CN/components/ai-chat.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@ export default {
1111
errorMessage2: '密码错误'
1212
},
1313
executionDetails: {
14+
title: '执行详情',
15+
paramInput: '参数输入',
1416
paramOutput: '参数输出',
17+
},
18+
tip: {
19+
error500Message: '抱歉,当前正在维护,无法提供服务,请稍后再试!',
20+
errorIdentifyMessage: '无法识别用户身份',
21+
errorLimitMessage:'抱歉,您的提问已达到最大限制,请明天再来吧!'
1522
}
1623
}

ui/src/locales/lang/zh_CN/views/application-workflow.ts

Lines changed: 127 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
import type { result } from 'lodash'
2+
13
export default {
24
node: '节点',
3-
baseNodes: '基础组件',
5+
baseComponent: '基础组件',
46
searchBar: {
57
placeholder: '按名称搜索'
68
},
@@ -27,10 +29,21 @@ export default {
2729
onlylest: '只允许连接左边的锚点',
2830
applicationNodeError: '该应用不可用',
2931
functionNodeError: '该函数不可用',
30-
repeatedNodeError: '节点名称已存在!'
32+
repeatedNodeError: '节点名称已存在!',
33+
cannotCopy: '不能被复制',
34+
copyError: '已复制节点'
3135
},
3236
delete: {
33-
confirmTitle: '确定删除该节点?'
37+
confirmTitle: '确定删除该节点?',
38+
deleteMessage: '节点不允许删除'
39+
},
40+
control: {
41+
zoomOut: '缩小',
42+
zoomIn: '放大',
43+
fitView: '适应',
44+
retract: '收起全部节点',
45+
extend: '展开全部节点',
46+
beautify: '一键美化'
3447
},
3548
variable: {
3649
global: '全局变量',
@@ -45,5 +58,116 @@ export default {
4558
AND: '所有',
4659
OR: '任一',
4760
text: '连线节点执行完,执行当前节点'
61+
},
62+
validate: {
63+
startNodeRequired: '开始节点必填',
64+
startNodeOnly: '开始节点只能有一个',
65+
baseNodeRequired: '基本信息节点必填',
66+
baseNodeOnly: '基本信息节点只能有一个',
67+
notInWorkFlowNode: '未在流程中的节点',
68+
noNextNode: '不存在的下一个节点',
69+
nodeUnavailable: '节点不可用',
70+
needConnect1: '节点的',
71+
needConnect2: '分支需要连接',
72+
cannotEndNode: '节点不能当做结束节点'
73+
},
74+
nodes: {
75+
startNode: {
76+
label: '开始',
77+
question: '用户问题',
78+
currentTime: '当前时间'
79+
},
80+
baseNode: {
81+
label: '基本信息'
82+
},
83+
aiChatNode: {
84+
label: 'AI 对话',
85+
text: '与 AI 大模型进行对话',
86+
answer: 'AI 回答内容'
87+
},
88+
searchDatasetNode: {
89+
label: '知识库检索',
90+
text: '关联知识库,查找与问题相关的分段',
91+
paragraph_list: '检索结果的分段列表',
92+
is_hit_handling_method_list: '满足直接回答的分段列表',
93+
result: '检索结果',
94+
directly_return: '满足直接回答的分段内容'
95+
},
96+
questionNode: {
97+
label: '问题优化',
98+
text: '根据历史聊天记录优化完善当前问题,更利于匹配知识库分段',
99+
result: '问题优化结果'
100+
},
101+
conditionNode: {
102+
label: '判断器',
103+
text: '根据不同条件执行不同的节点',
104+
branch_name: '分支名称'
105+
},
106+
replyNode: {
107+
label: '指定回复',
108+
text: '指定回复内容,引用变量会转换为字符串进行输出',
109+
content: '内容'
110+
},
111+
rerankerNode: {
112+
label: '多路召回',
113+
text: '使用重排模型对多个知识库的检索结果进行二次召回',
114+
result_list: '重排结果列表',
115+
result: '重排结果'
116+
},
117+
formNode: {
118+
label: '表单收集',
119+
text: '在问答过程中用于收集用户信息,可以根据收集到表单数据执行后续流程',
120+
form_content_format: `你好,请先填写下面表单内容:
121+
{{form}}
122+
填写后请点击【提交】按钮进行提交。`,
123+
form_data: '表单全部内容'
124+
},
125+
documentExtractNode: {
126+
label: '文档内容提取',
127+
text: '提取文档中的内容',
128+
content: '文档内容'
129+
},
130+
imageUnderstandNode: {
131+
label: '图片理解',
132+
text: '识别出图片中的对象、场景等信息回答用户问题',
133+
answer: 'AI 回答内容'
134+
},
135+
imageGenerateNode: {
136+
label: '图片生成',
137+
text: '根据提供的文本内容生成图片',
138+
answer: 'AI 回答内容',
139+
image: '图片'
140+
},
141+
speechToTextNode: {
142+
label: '语音转文本',
143+
text: '将音频通过语音识别模型转换为文本'
144+
},
145+
textToSpeechNode: {
146+
label: '文本转语音',
147+
text: '将文本通过语音合成模型转换为音频'
148+
},
149+
functionNode: {
150+
label: '自定义函数',
151+
text: '通过执行自定义脚本,实现数据处理'
152+
},
153+
applicationNode: {
154+
label: '应用节点'
155+
}
156+
},
157+
compare: {
158+
is_null: '为空',
159+
is_not_null: '不为空',
160+
contain: '包含',
161+
not_contain: '不包含',
162+
eq: '等于',
163+
ge: '大于等于',
164+
gt: '大于',
165+
le: '小于等于',
166+
lt: '小于',
167+
len_eq: '长度等于',
168+
len_ge: '长度大于等于',
169+
len_gt: '长度大于',
170+
len_le: '长度小于等于',
171+
len_lt: '长度小于'
48172
}
49173
}

ui/src/locales/lang/zh_CN/views/function-lib.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ export default {
6565
paramInfo1: '使用函数时显示',
6666
paramInfo2: '使用函数时不显示',
6767
code: '代码',
68-
result: '结果'
6968
},
7069
debug: {
7170
run: '运行',

ui/src/locales/lang/zh_TW/common.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ export default {
3939
debug: '調試',
4040
required: '必填',
4141
noData: '暂无数据',
42+
result: '結果',
4243
status: {
4344
label: '狀態',
4445
enableSuccess: '啟用成功',

ui/src/locales/lang/zh_TW/views/function-lib.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ export default {
6565
paramInfo1: '使用函數時顯示',
6666
paramInfo2: '使用函數時不顯示',
6767
code: '代碼',
68-
result: '結果'
6968
},
7069
debug: {
7170
run: '運行',

0 commit comments

Comments
 (0)