refactor(i18n): move generic keys to common

This commit is contained in:
BBQ
2026-02-13 01:11:06 +08:00
parent 3a1aa31611
commit 7e5612d474
10 changed files with 64 additions and 62 deletions
@@ -28,12 +28,12 @@
>
<FormItem>
<Label class="mb-2">
{{ $t('provider.name') }}
{{ $t('common.name') }}
</Label>
<FormControl>
<Input
type="text"
:placeholder="$t('provider.namePlaceholder')"
:placeholder="$t('common.namePlaceholder')"
v-bind="componentField"
/>
</FormControl>
@@ -79,12 +79,12 @@
>
<FormItem>
<Label class="mb-2">
{{ $t('provider.type') }}
{{ $t('common.type') }}
</Label>
<FormControl>
<Select v-bind="componentField">
<SelectTrigger class="w-full">
<SelectValue :placeholder="$t('provider.typePlaceholder')" />
<SelectValue :placeholder="$t('common.typePlaceholder')" />
</SelectTrigger>
<SelectContent>
<SelectGroup>
@@ -24,12 +24,12 @@
>
<FormItem>
<Label class="mb-2">
{{ $t('models.type') }}
{{ $t('common.type') }}
</Label>
<FormControl>
<Select v-bind="componentField">
<SelectTrigger class="w-full">
<SelectValue :placeholder="$t('models.typePlaceholder')" />
<SelectValue :placeholder="$t('common.typePlaceholder')" />
</SelectTrigger>
<SelectContent>
<SelectGroup>
+25 -24
View File
@@ -15,7 +15,25 @@
"import": "Import",
"export": "Export",
"copy": "Copy",
"copied": "Copied to clipboard"
"copied": "Copied to clipboard",
"tabAddSingle": "Add single",
"tabImportJson": "Import JSON",
"copyAsJson": "Copy as JSON",
"fillForm": "Fill form",
"batchSelected": "{count} selected",
"batchDelete": "Batch delete",
"batchDeleteConfirm": "Delete {count} selected item(s)?",
"batchExport": "Batch export",
"cancelSelection": "Cancel selection",
"name": "Name",
"namePlaceholder": "Enter name",
"type": "Type",
"typePlaceholder": "Select type",
"refresh": "Refresh",
"status": "Status",
"loadFailed": "Failed to load",
"saveFailed": "Failed to save",
"createdAt": "Created at"
},
"auth": {
"welcome": "Welcome Back",
@@ -119,8 +137,6 @@
"deleteModelConfirm": "Are you sure you want to delete this model?",
"emptyTitle": "No Models",
"emptyDescription": "Click the button above to add a model for this provider",
"type": "Type",
"typePlaceholder": "Select model type",
"model": "Model ID",
"modelPlaceholder": "e.g. gpt-4o",
"displayName": "Display Name",
@@ -132,14 +148,10 @@
"provider": {
"add": "Add Provider",
"addBtn": "Add",
"name": "Name",
"namePlaceholder": "Enter provider name",
"apiKey": "API Key",
"apiKeyPlaceholder": "Enter API key",
"url": "Base URL",
"urlPlaceholder": "Enter base URL",
"type": "Type",
"typePlaceholder": "Select type",
"deleteConfirm": "Are you sure you want to delete this provider?",
"saveChanges": "Save Changes",
"emptyTitle": "No Providers",
@@ -148,10 +160,6 @@
"mcp": {
"addTitle": "Add MCP",
"addDescription": "Configure MCP server connection",
"name": "Name",
"namePlaceholder": "Enter name",
"type": "Type",
"typePlaceholder": "Select type",
"command": "Command",
"commandPlaceholder": "Enter start command",
"arguments": "Arguments",
@@ -162,11 +170,10 @@
"envPlaceholder": "Format: KEY:VALUE",
"active": "Enable Now",
"types": {
"stdio": "Stdio"
"stdio": "Stdio (Local)",
"remote": "Remote (HTTP/SSE)"
},
"table": {
"name": "Name",
"type": "Type",
"command": "Command",
"cwd": "Working Directory",
"arguments": "Arguments",
@@ -207,7 +214,6 @@
"editAvatarDescription": "Set the image URL for the bot avatar.",
"avatarUpdateSuccess": "Avatar updated",
"avatarUpdateFailed": "Failed to update avatar",
"type": "Type",
"typePlaceholder": "Select bot type",
"types": {
"personal": "Personal",
@@ -229,9 +235,7 @@
"issueCount": "{count} issues",
"empty": "No check items",
"loadFailed": "Failed to load runtime checks",
"actions": {
"refresh": "Refresh"
},
"actions": {},
"keys": {
"containerInit": "Container initialization",
"containerRecord": "Container record",
@@ -246,7 +250,6 @@
"unknown": "UNKNOWN"
}
},
"createdAt": "Created at",
"tabs": {
"overview": "Overview",
"memory": "Memory",
@@ -299,7 +302,6 @@
"createdAt": "Created At"
},
"actions": {
"refresh": "Refresh",
"create": "Create Container",
"start": "Start",
"stop": "Stop",
@@ -334,10 +336,9 @@
"credentials": "Credentials",
"saveSuccess": "Platform configuration saved",
"saveFailed": "Failed to save platform configuration",
"requiredField": "{field} is required",
"save": "Save Platform Configuration",
"status": "Status",
"statusActive": "Active",
"requiredField": "{field} is required",
"save": "Save Platform Configuration",
"statusActive": "Active",
"statusInactive": "Inactive",
"deleteConfirm": "Are you sure you want to remove this platform?",
"noAvailableTypes": "All platform types have been configured",
+25 -24
View File
@@ -15,7 +15,25 @@
"import": "导入",
"export": "导出",
"copy": "复制",
"copied": "已复制到剪贴板"
"copied": "已复制到剪贴板",
"tabAddSingle": "添加单个",
"tabImportJson": "导入 JSON",
"copyAsJson": "复制为 JSON",
"fillForm": "填入表单",
"batchSelected": "已选 {count} 项",
"batchDelete": "批量删除",
"batchDeleteConfirm": "确定删除选中的 {count} 项?",
"batchExport": "批量导出",
"cancelSelection": "取消选择",
"name": "名称",
"namePlaceholder": "输入名称",
"type": "类型",
"typePlaceholder": "选择类型",
"refresh": "刷新",
"status": "状态",
"loadFailed": "加载失败",
"saveFailed": "保存失败",
"createdAt": "创建时间"
},
"auth": {
"welcome": "欢迎回来",
@@ -119,8 +137,6 @@
"deleteModelConfirm": "确定要删除这个模型吗?",
"emptyTitle": "暂无模型",
"emptyDescription": "点击上方按钮为当前服务商添加模型",
"type": "类型",
"typePlaceholder": "选择模型类型",
"model": "模型 ID",
"modelPlaceholder": "例如 gpt-4o",
"displayName": "显示名称",
@@ -132,14 +148,10 @@
"provider": {
"add": "添加服务商",
"addBtn": "添加",
"name": "名称",
"namePlaceholder": "输入服务商名称",
"apiKey": "API 密钥",
"apiKeyPlaceholder": "输入 API 密钥",
"url": "接口地址",
"urlPlaceholder": "输入接口地址",
"type": "类型",
"typePlaceholder": "选择类型",
"deleteConfirm": "确定要删除这个服务商吗?",
"saveChanges": "保存修改",
"emptyTitle": "暂无服务商",
@@ -148,10 +160,6 @@
"mcp": {
"addTitle": "添加 MCP",
"addDescription": "配置 MCP 服务器连接",
"name": "名称",
"namePlaceholder": "输入名称",
"type": "类型",
"typePlaceholder": "选择类型",
"command": "命令",
"commandPlaceholder": "输入启动命令",
"arguments": "参数",
@@ -162,11 +170,10 @@
"envPlaceholder": "格式:KEY:VALUE",
"active": "立即启用",
"types": {
"stdio": "Stdio"
"stdio": "本地命令 (Stdio)",
"remote": "远程服务 (HTTP/SSE)"
},
"table": {
"name": "名称",
"type": "类型",
"command": "命令",
"cwd": "工作目录",
"arguments": "参数",
@@ -207,7 +214,6 @@
"editAvatarDescription": "设置 Bot 头像图片的链接地址",
"avatarUpdateSuccess": "头像已更新",
"avatarUpdateFailed": "更新头像失败",
"type": "类型",
"typePlaceholder": "选择 Bot 类型",
"types": {
"personal": "个人",
@@ -229,9 +235,7 @@
"issueCount": "{count} 个异常",
"empty": "暂无检查项",
"loadFailed": "加载运行时检查失败",
"actions": {
"refresh": "刷新"
},
"actions": {},
"keys": {
"containerInit": "容器初始化",
"containerRecord": "容器记录",
@@ -246,7 +250,6 @@
"unknown": "未知"
}
},
"createdAt": "创建于",
"tabs": {
"overview": "概览",
"memory": "记忆",
@@ -299,7 +302,6 @@
"createdAt": "创建时间"
},
"actions": {
"refresh": "刷新",
"create": "创建容器",
"start": "启动",
"stop": "停止",
@@ -334,10 +336,9 @@
"credentials": "凭据配置",
"saveSuccess": "平台配置已保存",
"saveFailed": "平台配置保存失败",
"requiredField": "{field} 为必填项",
"save": "保存平台配置",
"status": "状态",
"statusActive": "启用",
"requiredField": "{field} 为必填项",
"save": "保存平台配置",
"statusActive": "启用",
"statusInactive": "停用",
"deleteConfirm": "确定要移除这个平台吗?",
"noAvailableTypes": "所有平台类型均已配置",
@@ -45,7 +45,7 @@
class="text-muted-foreground/60"
>·</span>
<span v-if="formattedDate">
{{ $t('bots.createdAt') }} {{ formattedDate }}
{{ $t('common.createdAt') }} {{ formattedDate }}
</span>
</div>
</div>
@@ -113,7 +113,7 @@
<!-- Status -->
<div class="flex items-center justify-between">
<Label>{{ $t('bots.channels.status') }}</Label>
<Label>{{ $t('common.status') }}</Label>
<Switch
:model-value="form.status === 'active'"
@update:model-value="(val) => form.status = val ? 'active' : 'inactive'"
@@ -65,7 +65,7 @@
>
<FormItem>
<Label class="mb-2">
{{ $t('bots.type') }}
{{ $t('common.type') }}
</Label>
<FormControl>
<Select v-bind="componentField">
+2 -2
View File
@@ -153,7 +153,7 @@
v-if="checksLoading"
class="mr-1.5"
/>
{{ $t('bots.checks.actions.refresh') }}
{{ $t('common.refresh') }}
</Button>
</div>
<div class="mt-3 flex items-center gap-2 text-sm">
@@ -247,7 +247,7 @@
v-if="containerLoading || containerAction === 'refresh'"
class="mr-1.5"
/>
{{ $t('bots.container.actions.refresh') }}
{{ $t('common.refresh') }}
</Button>
<Button
v-if="containerMissing"
@@ -3,7 +3,7 @@
<div class="**:[input]:mt-3 **:[input]:mb-4">
<section>
<h4 class="scroll-m-20 font-semibold tracking-tight">
{{ $t('provider.name') }}
{{ $t('common.name') }}
</h4>
<FormField
v-slot="{ componentField }"
@@ -13,7 +13,7 @@
<FormControl>
<Input
type="text"
:placeholder="$t('provider.namePlaceholder')"
:placeholder="$t('common.namePlaceholder')"
v-bind="componentField"
/>
</FormControl>
+1 -1
View File
@@ -141,7 +141,7 @@ const openStatus = reactive({
<SidebarFooter>
<Select v-model:model-value="filterProvider">
<SelectTrigger class="w-full">
<SelectValue :placeholder="$t('provider.typePlaceholder')" />
<SelectValue :placeholder="$t('common.typePlaceholder')" />
</SelectTrigger>
<SelectContent>
<SelectGroup>