Skip to content

Commit 5c4d61c

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

File tree

7 files changed

+74
-26
lines changed

7 files changed

+74
-26
lines changed

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

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,11 @@
198198
</div>
199199
<div class="card-never border-r-4 mt-8">
200200
<h5 class="p-8-12">
201-
{{ item.type == WorkflowType.Application ? '参数输出' : 'AI 回答' }}
201+
{{
202+
item.type == WorkflowType.Application
203+
? $t('components.chat.executionDetails.paramOutput')
204+
: 'AI 回答'
205+
}}
202206
</h5>
203207
<div class="p-8-12 border-t-dashed lighter">
204208
<MdPreview
@@ -236,7 +240,9 @@
236240
<template v-if="item.type === WorkflowType.DocumentExtractNode">
237241
<div class="card-never border-r-4">
238242
<h5 class="p-8-12 flex align-center">
239-
<span class="mr-4">参数输出</span>
243+
<span class="mr-4">{{
244+
$t('components.chat.executionDetails.paramOutput')
245+
}}</span>
240246

241247
<el-tooltip
242248
effect="dark"
@@ -291,7 +297,9 @@
291297
</div>
292298
</div>
293299
<div class="card-never border-r-4">
294-
<h5 class="p-8-12">参数输出</h5>
300+
<h5 class="p-8-12">
301+
{{ $t('components.chat.executionDetails.paramOutput') }}
302+
</h5>
295303
<div class="p-8-12 border-t-dashed lighter">
296304
<el-card
297305
shadow="never"
@@ -331,7 +339,9 @@
331339
</div>
332340
</div>
333341
<div class="card-never border-r-4">
334-
<h5 class="p-8-12">参数输出</h5>
342+
<h5 class="p-8-12">
343+
{{ $t('components.chat.executionDetails.paramOutput') }}
344+
</h5>
335345
<div class="p-8-12 border-t-dashed lighter">
336346
<p class="mb-8 color-secondary">语音文件:</p>
337347
<div v-if="item.answer" v-html="item.answer"></div>
@@ -429,7 +439,8 @@
429439
<template v-if="item.type === WorkflowType.FormNode">
430440
<div class="card-never border-r-4">
431441
<h5 class="p-8-12">
432-
参数输出<span style="color: #f54a45">{{
442+
{{ $t('components.chat.executionDetails.paramOutput')
443+
}}<span style="color: #f54a45">{{
433444
item.is_submit ? '' : '(用户未提交)'
434445
}}</span>
435446
</h5>
@@ -517,7 +528,11 @@
517528
</div>
518529
<div class="card-never border-r-4 mt-8">
519530
<h5 class="p-8-12">
520-
{{ item.type == WorkflowType.Application ? '参数输出' : 'AI 回答' }}
531+
{{
532+
item.type == WorkflowType.Application
533+
? $t('components.chat.executionDetails.paramOutput')
534+
: 'AI 回答'
535+
}}
521536
</h5>
522537
<div class="p-8-12 border-t-dashed lighter">
523538
<MdPreview
@@ -541,7 +556,11 @@
541556
</div>
542557
<div class="card-never border-r-4 mt-8">
543558
<h5 class="p-8-12">
544-
{{ item.type == WorkflowType.Application ? '参数输出' : 'AI 回答' }}
559+
{{
560+
item.type == WorkflowType.Application
561+
? $t('components.chat.executionDetails.paramOutput')
562+
: 'AI 回答'
563+
}}
545564
</h5>
546565
<div class="p-8-12 border-t-dashed lighter">
547566
<MdPreview

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { MsgSuccess } from '@/utils/message'
1414
import AppIcon from '@/components/icons/AppIcon.vue'
1515
import bus from '@/bus'
1616
import { ref, nextTick, onMounted } from 'vue'
17+
import { t } from '@/locales'
1718
const isOpen = ref<boolean>(false)
1819
const eventVal = ref({})
1920
function getSelection() {
@@ -42,14 +43,14 @@ const openControl = (event: any) => {
4243
4344
const menus = ref([
4445
{
45-
label: '复制',
46+
label: t('common.copy'),
4647
icon: 'app-copy',
4748
click: () => {
4849
const selectionText = getSelection()
4950
if (selectionText) {
5051
clearSelectedText()
5152
navigator.clipboard.writeText(selectionText).then(() => {
52-
MsgSuccess('复制成功')
53+
MsgSuccess(t('common.copySuccess'))
5354
})
5455
}
5556
}

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,8 @@ export default {
99
title: '请输入密码打开链接',
1010
errorMessage1: '密码不能为空',
1111
errorMessage2: '密码错误'
12+
},
13+
executionDetails: {
14+
paramOutput: '参数输出',
1215
}
1316
}

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

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,35 @@ export default {
1515
public: '发布',
1616
releaseHistory: '发布历史',
1717
autoSave: '自动保存',
18-
latestRelease: '最近发布'
18+
latestRelease: '最近发布',
19+
copyParam: '复制参数'
1920
},
2021
tip: {
2122
publicSuccess: '发布成功',
2223
noData: '没有找到相关结果',
2324
nameMessage: '名字不能为空!',
2425
onlyRight: '只允许从右边的锚点连出',
2526
notRecyclable: '不可循环连线',
26-
onlylest: '只允许连接左边的锚点'
27+
onlylest: '只允许连接左边的锚点',
28+
applicationNodeError: '该应用不可用',
29+
functionNodeError: '该函数不可用',
30+
repeatedNodeError: '节点名称已存在!'
31+
},
32+
delete: {
33+
confirmTitle: '确定删除该节点?'
2734
},
2835
variable: {
2936
global: '全局变量',
3037
Referencing: '引用变量',
3138
ReferencingRequired: '引用变量必填',
3239
ReferencingError: '引用变量错误',
33-
NoReferencing:'不存在的引用变量',
40+
NoReferencing: '不存在的引用变量'
41+
},
42+
condition: {
43+
title: '执行条件',
44+
front: '前置',
45+
AND: '所有',
46+
OR: '任一',
47+
text: '连线节点执行完,执行当前节点'
3448
}
3549
}

ui/src/workflow/common/NodeContainer.vue

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,17 @@
4949
</el-button>
5050
<template #dropdown>
5151
<div style="width: 280px" class="p-12-16">
52-
<h5>执行条件</h5>
52+
<h5>{{ $t('views.applicationWorkflow.condition.title') }}</h5>
5353
<p class="mt-8 lighter">
54-
<span>前置</span>
54+
<span>{{ $t('views.applicationWorkflow.condition.front') }}</span>
5555
<el-select v-model="condition" size="small" style="width: 60px; margin: 0 8px">
56-
<el-option label="所有" value="AND" />
57-
<el-option label="任一" value="OR" />
56+
<el-option
57+
:label="$t('views.applicationWorkflow.condition.AND')"
58+
value="AND"
59+
/>
60+
<el-option :label="$t('views.applicationWorkflow.condition.OR')" value="OR" />
5861
</el-select>
59-
<span>连线节点执行完,执行当前节点</span>
62+
<span>{{ $t('views.applicationWorkflow.condition.text') }}</span>
6063
</p>
6164
</div>
6265
</template>
@@ -67,7 +70,9 @@
6770
</el-button>
6871
<template #dropdown>
6972
<el-dropdown-menu style="min-width: 80px">
70-
<el-dropdown-item @click="copyNode" class="p-8">复制</el-dropdown-item>
73+
<el-dropdown-item @click="copyNode" class="p-8">{{
74+
$t('common.copy')
75+
}}</el-dropdown-item>
7176
<el-dropdown-item @click="deleteNode" class="border-t p-8">{{
7277
$t('common.delete')
7378
}}</el-dropdown-item>
@@ -81,14 +86,20 @@
8186
<el-alert
8287
v-if="node_status != 200"
8388
class="mb-16"
84-
:title="props.nodeModel.type === 'application-node' ? '该应用不可用' : '该函数不可用'"
89+
:title="
90+
props.nodeModel.type === 'application-node'
91+
? $t('views.applicationWorkflow.tip.applicationNodeError')
92+
: $t('views.applicationWorkflow.tip.functionNodeError')
93+
"
8594
type="error"
8695
show-icon
8796
:closable="false"
8897
/>
8998
<slot></slot>
9099
<template v-if="nodeFields.length > 0">
91-
<h5 class="title-decoration-1 mb-8 mt-8">参数输出</h5>
100+
<h5 class="title-decoration-1 mb-8 mt-8">
101+
{{ $t('components.chat.executionDetails.paramOutput') }}
102+
</h5>
92103
<template v-for="(item, index) in nodeFields" :key="index">
93104
<div
94105
class="flex-between border-r-4 p-8-12 mb-8 layout-bg lighter"
@@ -98,7 +109,7 @@
98109
<span style="max-width: 92%">{{ item.label }} {{ '{' + item.value + '}' }}</span>
99110
<el-tooltip
100111
effect="dark"
101-
content="复制参数"
112+
:content="$t('views.applicationWorkflow.setting.copyParam')"
102113
placement="top"
103114
v-if="showicon === index"
104115
>
@@ -138,7 +149,7 @@ import { iconComponent } from '../icons/utils'
138149
import { copyClick } from '@/utils/clipboard'
139150
import { WorkflowType } from '@/enums/workflow'
140151
import { MsgError, MsgConfirm } from '@/utils/message'
141-
152+
import { t } from '@/locales'
142153
const {
143154
params: { id }
144155
} = app.config.globalProperties.$route as any
@@ -200,7 +211,7 @@ function editName(val: string) {
200211
) {
201212
set(props.nodeModel.properties, 'stepName', val.trim())
202213
} else {
203-
MsgError('节点名称已存在!')
214+
MsgError(t('views.applicationWorkflow.tip.repeatedNodeError'))
204215
}
205216
}
206217
}
@@ -219,7 +230,7 @@ const copyNode = () => {
219230
props.nodeModel.graphModel.toFront(cloneNode.id)
220231
}
221232
const deleteNode = () => {
222-
MsgConfirm(t('common.tip'), `确定删除该节点?`, {
233+
MsgConfirm(t('common.tip'), t('views.applicationWorkflow.delete.confirmTitle'), {
223234
confirmButtonText: t('common.delete'),
224235
confirmButtonClass: 'danger'
225236
}).then(() => {

ui/src/workflow/common/shortcut.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ export function initDefaultShortcut(lf: LogicFlow, graph: GraphModel) {
9999
MsgError(`${nodes[0].properties?.stepName}节点不允许删除`)
100100
return
101101
}
102-
MsgConfirm(t('common.tip'), `确定删除该节点?`, {
102+
MsgConfirm(t('common.tip'), t('views.applicationWorkflow.delete.confirmTitle'), {
103103
confirmButtonText: t('common.delete'),
104104
confirmButtonClass: 'danger'
105105
}).then(() => {

ui/src/workflow/nodes/start-node/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
@mouseleave="showicon = false"
1010
>
1111
<span>{{ item.label }} {{ '{' + item.value + '}' }}</span>
12-
<el-tooltip effect="dark" content="复制参数" placement="top" v-if="showicon === true">
12+
<el-tooltip effect="dark" :content="$t('views.applicationWorkflow.setting.copyParam')" placement="top" v-if="showicon === true">
1313
<el-button
1414
link
1515
@click="copyClick('{{' + '全局变量.' + item.value + '}}')"

0 commit comments

Comments
 (0)