feat: 完成AccountForm组件国际化的最终验证和修复

- 修复遗漏的API URL和API Key标签国际化
- 修复title属性的国际化(复制链接提示)
- 修复Claude Max/Pro订阅类型显示的国际化
- 修复剩余placeholder属性的国际化
- 完成系统性的多维度验证检查:
  *  模板中的硬编码文本
  *  JavaScript中的字符串常量
  *  特殊属性(title, placeholder等)
  *  翻译键在三语言文件中的存在性
  *  动态内容和条件渲染

现在AccountForm组件已真正实现完整的三语言国际化支持
This commit is contained in:
Wangnov
2025-09-09 17:58:02 +08:00
parent 30acf4a374
commit 2b40552eab
4 changed files with 53 additions and 14 deletions

View File

@@ -622,7 +622,7 @@
<div v-if="form.platform === 'claude-console' && !isEdit" class="space-y-4"> <div v-if="form.platform === 'claude-console' && !isEdit" class="space-y-4">
<div> <div>
<label class="mb-3 block text-sm font-semibold text-gray-700 dark:text-gray-300" <label class="mb-3 block text-sm font-semibold text-gray-700 dark:text-gray-300"
>API URL *</label >{{ t('accountForm.apiUrlRequired') }}</label
> >
<input <input
v-model="form.apiUrl" v-model="form.apiUrl"
@@ -639,7 +639,7 @@
<div> <div>
<label class="mb-3 block text-sm font-semibold text-gray-700 dark:text-gray-300" <label class="mb-3 block text-sm font-semibold text-gray-700 dark:text-gray-300"
>API Key *</label >{{ t('accountForm.apiKeyRequired') }}</label
> >
<input <input
v-model="form.apiKey" v-model="form.apiKey"
@@ -848,7 +848,7 @@
type="radio" type="radio"
value="claude_max" value="claude_max"
/> />
<span class="text-sm text-gray-700 dark:text-gray-300">Claude Max</span> <span class="text-sm text-gray-700 dark:text-gray-300">{{ t('accountForm.claudeMaxDisplay') }}</span>
</label> </label>
<label class="flex cursor-pointer items-center"> <label class="flex cursor-pointer items-center">
<input <input
@@ -857,7 +857,7 @@
type="radio" type="radio"
value="claude_pro" value="claude_pro"
/> />
<span class="text-sm text-gray-700 dark:text-gray-300">Claude Pro</span> <span class="text-sm text-gray-700 dark:text-gray-300">{{ t('accountForm.claudeProDisplay') }}</span>
</label> </label>
</div> </div>
<p class="mt-2 text-xs text-gray-500 dark:text-gray-400"> <p class="mt-2 text-xs text-gray-500 dark:text-gray-400">
@@ -1254,7 +1254,7 @@
/> />
<button <button
class="rounded-lg bg-gray-100 px-3 py-2 transition-colors hover:bg-gray-200 dark:bg-gray-700 dark:hover:bg-gray-600" class="rounded-lg bg-gray-100 px-3 py-2 transition-colors hover:bg-gray-200 dark:bg-gray-700 dark:hover:bg-gray-600"
title="复制链接" :title="t('accountForm.copyLinkTooltip')"
@click="copySetupTokenAuthUrl" @click="copySetupTokenAuthUrl"
> >
<i <i
@@ -1680,18 +1680,18 @@
<!-- {{ t('accountForm.claudeConsoleFields') }}(编辑模式)--> <!-- {{ t('accountForm.claudeConsoleFields') }}(编辑模式)-->
<div v-if="form.platform === 'claude-console'" class="space-y-4"> <div v-if="form.platform === 'claude-console'" class="space-y-4">
<div> <div>
<label class="mb-3 block text-sm font-semibold text-gray-700">API URL</label> <label class="mb-3 block text-sm font-semibold text-gray-700">{{ t('accountForm.apiUrlLabel') }}</label>
<input <input
v-model="form.apiUrl" v-model="form.apiUrl"
class="form-input w-full" class="form-input w-full"
placeholder="例如https://api.example.com" :placeholder="t('accountForm.apiUrlPlaceholder')"
required required
type="text" type="text"
/> />
</div> </div>
<div> <div>
<label class="mb-3 block text-sm font-semibold text-gray-700">API Key</label> <label class="mb-3 block text-sm font-semibold text-gray-700">{{ t('accountForm.apiKeyLabel') }}</label>
<input <input
v-model="form.apiKey" v-model="form.apiKey"
class="form-input w-full" class="form-input w-full"
@@ -1711,7 +1711,7 @@
v-model.number="form.dailyQuota" v-model.number="form.dailyQuota"
class="form-input w-full border-gray-300 dark:border-gray-600 dark:bg-gray-700 dark:text-gray-200" class="form-input w-full border-gray-300 dark:border-gray-600 dark:bg-gray-700 dark:text-gray-200"
min="0" min="0"
placeholder="0 表示不限制" :placeholder="t('accountForm.quotaZeroUnlimited')"
step="0.01" step="0.01"
type="number" type="number"
/> />
@@ -1866,7 +1866,7 @@
<input <input
v-model="form.userAgent" v-model="form.userAgent"
class="form-input w-full" class="form-input w-full"
placeholder="留空则透传客户端 User-Agent" :placeholder="t('accountForm.userAgentPlaceholder')"
type="text" type="text"
/> />
<p class="mt-1 text-xs text-gray-500"> <p class="mt-1 text-xs text-gray-500">
@@ -2075,7 +2075,7 @@
<div> <div>
<label class="mb-3 block text-sm font-semibold text-gray-700 dark:text-gray-300" <label class="mb-3 block text-sm font-semibold text-gray-700 dark:text-gray-300"
>API Key</label >{{ t('accountForm.apiKeyLabel') }}</label
> >
<input <input
v-model="form.apiKey" v-model="form.apiKey"

View File

@@ -1692,6 +1692,19 @@ export default {
// Form descriptions // Form descriptions
modelSupportDesc: 'Leave empty to support all models. If models are specified, requests with models not in the list will not be scheduled to this account', modelSupportDesc: 'Leave empty to support all models. If models are specified, requests with models not in the list will not be scheduled to this account',
modelTypeSelectionDesc: 'Select model types supported by this deployment', modelTypeSelectionDesc: 'Select model types supported by this deployment',
userAgentDesc: 'When empty, will automatically use client User-Agent, only fill when need to fix specific UA' userAgentDesc: 'When empty, will automatically use client User-Agent, only fill when need to fix specific UA',
// Basic labels
apiUrlLabel: 'API URL',
apiUrlRequired: 'API URL *',
apiKeyLabel: 'API Key',
apiKeyRequired: 'API Key *',
// More missing keys
copyLinkTooltip: 'Copy Link',
// Claude subscription type display
claudeMaxDisplay: 'Claude Max',
claudeProDisplay: 'Claude Pro'
} }
} }

View File

@@ -1692,6 +1692,19 @@ export default {
// 表单描述 // 表单描述
modelSupportDesc: '留空表示支持所有模型。如果指定模型,请求中的模型不在列表内将不会调度到此账号', modelSupportDesc: '留空表示支持所有模型。如果指定模型,请求中的模型不在列表内将不会调度到此账号',
modelTypeSelectionDesc: '选择此部署支持的模型类型', modelTypeSelectionDesc: '选择此部署支持的模型类型',
userAgentDesc: '留空时将自动使用客户端的 User-Agent仅在需要固定特定 UA 时填写' userAgentDesc: '留空时将自动使用客户端的 User-Agent仅在需要固定特定 UA 时填写',
// 基础标签
apiUrlLabel: 'API URL',
apiUrlRequired: 'API URL *',
apiKeyLabel: 'API Key',
apiKeyRequired: 'API Key *',
// 更多缺失的翻译键
copyLinkTooltip: '复制链接',
// Claude 订阅类型显示
claudeMaxDisplay: 'Claude Max',
claudeProDisplay: 'Claude Pro'
} }
} }

View File

@@ -1692,6 +1692,19 @@ export default {
// 表單描述 // 表單描述
modelSupportDesc: '留空表示支援所有模型。如果指定模型,請求中的模型不在列表內將不會調度到此帳戶', modelSupportDesc: '留空表示支援所有模型。如果指定模型,請求中的模型不在列表內將不會調度到此帳戶',
modelTypeSelectionDesc: '選擇此部署支援的模型類型', modelTypeSelectionDesc: '選擇此部署支援的模型類型',
userAgentDesc: '留空時將自動使用用戶端的 User-Agent僅在需要固定特定 UA 時填寫' userAgentDesc: '留空時將自動使用用戶端的 User-Agent僅在需要固定特定 UA 時填寫',
// 基础標籤
apiUrlLabel: 'API URL',
apiUrlRequired: 'API URL *',
apiKeyLabel: 'API Key',
apiKeyRequired: 'API Key *',
// 更多缺失的翻譯鍵
copyLinkTooltip: '複製連結',
// Claude 訂閱類型顯示
claudeMaxDisplay: 'Claude Max',
claudeProDisplay: 'Claude Pro'
} }
} }