feat: 完成多个组件的国际化支持与文本替换

- 更新 AccountForm.vue 中的占位符文本为 i18n 语言包中的键
- 修改 ConfirmModal.vue 中的确认和取消按钮文本为 i18n 语言包中的键
- 更新 CustomDropdown.vue 中的占位符文本为 i18n 语言包中的键
- 修改 app.js 中的应用标题为英文版本
- 更新 router/index.js 中的日志输出为英文
- 在 accounts.js 和 apiKeys.js 中的错误处理信息中引入 i18n 键以提升多语言一致性
- 更新 dashboard.js 中的系统状态和错误日志为 i18n 键
- 在 DashboardView.vue 中的多个文本替换为 i18n 语言包中的键
This commit is contained in:
Wangnov
2025-09-11 18:03:54 +08:00
parent 22e27738aa
commit e36bacfd6b
11 changed files with 59 additions and 40 deletions

View File

@@ -309,13 +309,13 @@
}}</span></span
>
<span v-if="(dashboardData.totalCacheCreateTokens || 0) > 0" class="text-purple-600"
>缓存创建:
>{{ t('dashboard.cacheCreateTokens') }}:
<span class="font-medium">{{
formatNumber(dashboardData.totalCacheCreateTokens || 0)
}}</span></span
>
<span v-if="(dashboardData.totalCacheReadTokens || 0) > 0" class="text-purple-600"
>缓存读取:
>{{ t('dashboard.cacheReadTokens') }}:
<span class="font-medium">{{
formatNumber(dashboardData.totalCacheReadTokens || 0)
}}</span></span
@@ -930,11 +930,14 @@ function createUsageTrendChart() {
const bLabel = b.dataset.label || ''
// 费用和请求数使用不同的轴,单独处理
if (aLabel === '费用 (USD)' || bLabel === '费用 (USD)') {
return aLabel === '费用 (USD)' ? -1 : 1
if (aLabel === t('dashboard.costLabel') || bLabel === t('dashboard.costLabel')) {
return aLabel === t('dashboard.costLabel') ? -1 : 1
}
if (aLabel === '请求数' || bLabel === '请求数') {
return aLabel === '请求数' ? 1 : -1
if (
aLabel === t('dashboard.requestsLabel') ||
bLabel === t('dashboard.requestsLabel')
) {
return aLabel === t('dashboard.requestsLabel') ? 1 : -1
}
// 其他按token值倒序
@@ -945,15 +948,15 @@ function createUsageTrendChart() {
const label = context.dataset.label || ''
let value = context.parsed.y
if (label === '费用 (USD)') {
if (label === t('dashboard.costLabel')) {
// 格式化费用显示
if (value < 0.01) {
return label + ': $' + value.toFixed(6)
} else {
return label + ': $' + value.toFixed(4)
}
} else if (label === '请求数') {
return label + ': ' + value.toLocaleString() + ' 次'
} else if (label === t('dashboard.requestsLabel')) {
return label + ': ' + value.toLocaleString()
} else {
// 格式化token数显示
if (value >= 1000000) {