Skip to content

Commit 73faaf6

Browse files
authored
i18n(SubAgentPage): complete internationalization for subagent orchestration page (#5400)
* i18n: complete internationalization for subagent orchestration page - Replace hardcoded English strings in [SubAgentPage.vue] with i18n keys. - Update `en-US` and `zh-CN` locales with missing hints, validation messages, and empty state translations. - Fix translation typos and improve consistency across the SubAgent orchestration UI. * fix(bug_risk): 避免在模板中的翻译调用上使用 || 'Close' 作为回退值。
1 parent 29dbd08 commit 73faaf6

File tree

3 files changed

+37
-15
lines changed

3 files changed

+37
-15
lines changed

dashboard/src/i18n/locales/en-US/features/subagent.json

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,14 @@
88
"refresh": "Refresh",
99
"save": "Save",
1010
"add": "Add SubAgent",
11-
"delete": "Delete"
11+
"delete": "Delete",
12+
"close": "Close"
1213
},
1314
"switches": {
1415
"enable": "Enable SubAgent orchestration",
15-
"dedupe": "Deduplicate main LLM tools (hide tools duplicated by SubAgents)"
16+
"enableHint": "Enable sub-agent functionality",
17+
"dedupe": "Deduplicate main LLM tools (hide tools duplicated by SubAgents)",
18+
"dedupeHint": "Remove duplicate tools from main agent"
1619
},
1720
"description": {
1821
"disabled": "When off: SubAgent is disabled; the main LLM mounts tools via persona rules (all by default) and calls them directly.",
@@ -29,7 +32,8 @@
2932
"transferPrefix": "transfer_to_{name}",
3033
"switchLabel": "Enable",
3134
"previewTitle": "Preview: handoff tool shown to the main LLM",
32-
"personaChip": "Persona: {id}"
35+
"personaChip": "Persona: {id}",
36+
"personaPreview": "PERSONA PREVIEW"
3337
},
3438
"form": {
3539
"nameLabel": "Agent name (used for transfer_to_{name})",
@@ -49,6 +53,13 @@
4953
"nameDuplicate": "Duplicate SubAgent name: {name}",
5054
"personaMissing": "SubAgent {name} has no persona selected",
5155
"saveSuccess": "Saved successfully",
52-
"saveFailed": "Failed to save"
56+
"saveFailed": "Failed to save",
57+
"nameRequired": "Name is required",
58+
"namePattern": "Lowercase letters, numbers, underscore only"
59+
},
60+
"empty": {
61+
"title": "No Agents Configured",
62+
"subtitle": "Add a new sub-agent to get started",
63+
"action": "Create First Agent"
5364
}
5465
}

dashboard/src/i18n/locales/zh-CN/features/subagent.json

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,14 @@
88
"refresh": "刷新",
99
"save": "保存",
1010
"add": "新增 SubAgent",
11-
"delete": "删除"
11+
"delete": "删除",
12+
"close": "关闭"
1213
},
1314
"switches": {
1415
"enable": "启用 SubAgent 编排",
15-
"dedupe": "主 LLM 去重重复工具(与 SubAgent 重叠的工具将被隐藏)"
16+
"enableHint": "启用子代理功能",
17+
"dedupe": "主 LLM 去重重复工具(与 SubAgent 重叠的工具将被隐藏)",
18+
"dedupeHint": "从主代理中移除重复工具"
1619
},
1720
"description": {
1821
"disabled": "不启动:SubAgent 关闭;主 LLM 按 persona 规则挂载工具(默认全部),并直接调用。",
@@ -39,6 +42,7 @@
3942
"providerHint": "留空表示跟随全局默认 provider。",
4043
"personaLabel": "选择人格设定",
4144
"personaHint": "SubAgent 将直接继承所选 Persona 的系统设定与工具。在人格设定页管理和新建人格。",
45+
"personaPreview": "人格预览",
4246
"descriptionLabel": "对主 LLM 的描述(用于决定是否 handoff)",
4347
"descriptionHint": "这段会作为 transfer_to_* 工具的描述给主 LLM 看,建议简短明确。"
4448
},
@@ -50,6 +54,13 @@
5054
"nameDuplicate": "SubAgent 名称重复:{name}",
5155
"personaMissing": "SubAgent {name} 未选择 Persona",
5256
"saveSuccess": "保存成功",
53-
"saveFailed": "保存失败"
57+
"saveFailed": "保存失败",
58+
"nameRequired": "名称必填",
59+
"namePattern": "仅支持小写字母、数字和下划线"
60+
},
61+
"empty": {
62+
"title": "未配置 SubAgent",
63+
"subtitle": "添加一个新的子代理以开始",
64+
"action": "创建第一个 Agent"
5465
}
5566
}

dashboard/src/views/SubAgentPage.vue

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
<template #label>
6363
<div class="d-flex flex-column">
6464
<span class="text-body-2 font-weight-medium">{{ tm('switches.enable') }}</span>
65-
<span class="text-caption text-medium-emphasis">Enable sub-agent functionality</span>
65+
<span class="text-caption text-medium-emphasis">{{ tm('switches.enableHint') }}</span>
6666
</div>
6767
</template>
6868
</v-switch>
@@ -80,7 +80,7 @@
8080
<template #label>
8181
<div class="d-flex flex-column">
8282
<span class="text-body-2 font-weight-medium">{{ tm('switches.dedupe') }}</span>
83-
<span class="text-caption text-medium-emphasis">Remove duplicate tools from main agent</span>
83+
<span class="text-caption text-medium-emphasis">{{ tm('switches.dedupeHint') }}</span>
8484
</div>
8585
</template>
8686
</v-switch>
@@ -166,7 +166,7 @@
166166
<v-text-field
167167
v-model="agent.name"
168168
:label="tm('form.nameLabel')"
169-
:rules="[v => !!v || 'Name is required', v => /^[a-z][a-z0-9_]*$/.test(v) || 'Lowercase letters, numbers, underscore only']"
169+
:rules="[v => !!v || tm('messages.nameRequired'), v => /^[a-z][a-z0-9_]*$/.test(v) || tm('messages.namePattern')]"
170170
variant="outlined"
171171
density="comfortable"
172172
hide-details="auto"
@@ -215,7 +215,7 @@
215215
<v-col cols="12" md="6">
216216
<div class="h-100">
217217
<div class="text-caption font-weight-bold text-medium-emphasis mb-2 ml-1">
218-
PERSONA PREVIEW
218+
{{ tm('cards.personaPreview') }}
219219
</div>
220220
<PersonaQuickPreview
221221
:model-value="agent.persona_id"
@@ -231,17 +231,17 @@
231231
<!-- Empty State -->
232232
<div v-if="cfg.agents.length === 0" class="d-flex flex-column align-center justify-center py-12 text-medium-emphasis">
233233
<v-icon icon="mdi-robot-off" size="64" class="mb-4 opacity-50" />
234-
<div class="text-h6">No Agents Configured</div>
235-
<div class="text-body-2 mb-4">Add a new sub-agent to get started</div>
234+
<div class="text-h6">{{ tm('empty.title') }}</div>
235+
<div class="text-body-2 mb-4">{{ tm('empty.subtitle') }}</div>
236236
<v-btn color="primary" variant="tonal" @click="addAgent">
237-
Create First Agent
237+
{{ tm('empty.action') }}
238238
</v-btn>
239239
</div>
240240

241241
<v-snackbar v-model="snackbar.show" :color="snackbar.color" timeout="3000" location="top">
242242
{{ snackbar.message }}
243243
<template #actions>
244-
<v-btn variant="text" @click="snackbar.show = false">Close</v-btn>
244+
<v-btn variant="text" @click="snackbar.show = false">{{ tm('actions.close') }}</v-btn>
245245
</template>
246246
</v-snackbar>
247247
</div>

0 commit comments

Comments
 (0)