From ac9bbfd4727cce53903d1c4aa5dd3c0b88a4654a Mon Sep 17 00:00:00 2001 From: zhanjunhao <642307404@qq.com> Date: Tue, 17 Nov 2026 14:10:25 +0800 Subject: [PATCH] =?UTF-8?q?fix(i18n):=20=E8=A1=A5=E9=BD=90=E4=B9=9D?= =?UTF-8?q?=E8=AF=AD=E7=BF=BB=E8=AF=91=E5=B9=B6=E4=BF=AE=E5=A4=8D=E5=9B=BD?= =?UTF-8?q?=E9=99=85=E5=8C=96=E6=A3=80=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 补齐历史缺译并统一整句插值。九语覆盖 100%,静态检查及 713 项单测通过。 --- docs/CHANGELOG.md | 12 +- .../analytics/ChannelConsumption.jsx | 3 +- .../analytics/RiskControlBanLogs.jsx | 7 +- .../analytics/RiskControlRulesModal.jsx | 8 +- .../analytics/TopupChannelChart.jsx | 4 +- src/components/analytics/UserRanking.jsx | 13 +- src/components/analytics/UserTopupRanking.jsx | 11 +- .../analytics/orgReport/Analysis.jsx | Bin 20106 -> 20232 bytes .../analytics/orgReport/Overview.jsx | 19 +- src/components/auth/AuthCardHeader.jsx | 58 +- src/components/auth/LoginForm.jsx | 2 +- src/components/auth/PasswordResetConfirm.jsx | 6 +- src/components/auth/PasswordResetForm.jsx | 6 +- src/components/auth/RegisterForm.jsx | 2 +- src/components/auth/TwoFAVerification.jsx | 29 +- src/components/common/ChunkErrorBoundary.jsx | 4 +- src/components/common/PageGuide/index.jsx | 11 +- src/components/common/ui/RichTextEditor.jsx | 16 +- .../layout/headerbar/HeaderLogo.jsx | 2 +- .../layout/headerbar/NewYearButton.jsx | 7 +- src/components/playground/ChatArea.jsx | 3 +- src/components/playground/CodeViewer.jsx | 5 +- .../playground/CustomInputRender.jsx | 4 +- .../playground/CustomRequestEditor.jsx | 3 +- src/components/playground/DebugPanel.jsx | 4 +- .../playground/ImagePreviewModal.jsx | 7 +- src/components/playground/ImageUrlInput.jsx | 11 +- src/components/playground/MessageContent.jsx | 5 +- src/components/playground/SSEViewer.jsx | 5 +- src/components/quality/QualityHeatmap.jsx | 19 +- src/components/quality/QualityOverview.jsx | 26 +- .../settings/ContentGuardSetting.jsx | 5 +- src/components/settings/DashboardSetting.jsx | 4 +- .../settings/DataSecuritySetting.jsx | 7 +- .../settings/LevelPolicySetting.jsx | 59 +- src/components/settings/OperationSetting.jsx | 2 +- src/components/settings/OtherSetting.jsx | 2 +- src/components/settings/PersonalSetting.jsx | 4 +- src/components/settings/SystemSetting.jsx | 60 +- .../settings/personal/cards/ModelsList.jsx | 12 +- .../personal/cards/NotificationSettings.jsx | 33 +- .../personal/components/TwoFASetting.jsx | 9 +- .../setup/components/steps/DatabaseStep.jsx | 4 +- .../modals/AdminEditTokenModal.jsx | 34 +- .../table/channels/ChannelsColumnDefs.jsx | 4 +- .../channels/modals/EditChannelModal.jsx | 69 +- .../table/channels/modals/EditTagModal.jsx | 25 +- .../table/channels/modals/ModelTestModal.jsx | 2 +- .../modal/components/ModelBasicInfo.jsx | 4 +- .../models/modals/BatchCategoryModal.jsx | 2 +- .../models/modals/MissingModelsModal.jsx | 7 +- .../table/tokens/TokensColumnDefs.jsx | 8 +- .../table/users/modals/InvitedUsersModal.jsx | 11 +- src/components/topup/RechargeCard.jsx | 10 +- src/components/topup/index.jsx | 4 +- .../topup/modals/PaymentConfirmModal.jsx | 16 +- src/components/topup/modals/TransferModal.jsx | 7 +- src/helpers/render.jsx | 44 +- src/helpers/utils.jsx | 20 +- src/hooks/mj-logs/useMjLogsData.js | 2 +- .../model-pricing/useModelPricingData.jsx | 2 +- src/hooks/playground/useApiRequest.jsx | 5 +- src/hooks/task-logs/useTaskLogsData.js | 2 +- src/i18n/i18n.js | 9 +- src/i18n/locale-coverage.test.js | 50 +- src/i18n/locales/en.json | 220 +- src/i18n/locales/fr.json | 11820 ++++++++------- src/i18n/locales/ja.json | 206 +- src/i18n/locales/ko.json | 191 +- src/i18n/locales/ru.json | 12168 +++++++++------- src/i18n/locales/th.json | 206 +- src/i18n/locales/vi.json | 206 +- src/i18n/locales/zh-TW.json | 187 +- src/i18n/locales/zh.json | 214 +- src/i18n/technicalText.js | 113 + src/pages/AdminInvoice/index.jsx | 21 +- src/pages/AdminOrder/index.jsx | 24 +- src/pages/CloudBrain/index.jsx | 27 +- src/pages/Docs/index.jsx | 44 +- .../AICreation/ImageGenerationForm.jsx | 9 +- .../AICreation/Video/VideoPreviewPanel.jsx | 46 +- .../components/ExperienceSidebar.jsx | 3 +- src/pages/ExperienceCenter/index.jsx | 3 +- src/pages/ExpertPlatform/index.jsx | 28 +- src/pages/Home/index.jsx | 8 +- src/pages/KeyManagement/index.jsx | 29 +- src/pages/LogoShowcase/index.jsx | 5 +- src/pages/MonitorCenter/AdminMonitor.jsx | 21 +- src/pages/MonitorCenter/ChannelMonitor.jsx | 6 +- .../components/ChannelMonitorView.jsx | 4 +- src/pages/Organization/OrgConnectors.jsx | 8 +- src/pages/Organization/OrgDashboard.jsx | 10 +- src/pages/Organization/OrgEffectiveness.jsx | 11 +- src/pages/Organization/OrgKnowledge.jsx | 4 +- src/pages/Organization/OrgLogs.jsx | 8 +- src/pages/Organization/OrgMembers.jsx | 27 +- src/pages/Organization/OrgMyConnectors.jsx | 16 +- .../Organization/OrgPersonalSettings.jsx | 13 +- src/pages/Organization/OrgPrivateSkills.jsx | 4 +- src/pages/Organization/OrgRecharge.jsx | 6 +- src/pages/Organization/OrgResolver.jsx | 2 +- src/pages/Organization/OrgSidebar.jsx | 6 +- .../components/DeptFlowCanvas.jsx | 7 +- .../Organization/datasecurity/OrgDsPolicy.jsx | 7 +- .../Organization/datasecurity/OrgDsRules.jsx | 2 +- src/pages/PartnerPortal/Workbench.jsx | 17 +- src/pages/Recharge/MembershipPanel.jsx | 12 +- src/pages/Recharge/RechargePanel.jsx | 6 +- src/pages/Recharge/index.jsx | 4 +- src/pages/ServiceDashboard/GroupMonitor.jsx | 21 +- .../ServiceDashboard/GroupMonitorAdmin.jsx | 23 +- .../Setting/Dashboard/SettingsAPIInfo.jsx | 2 +- .../Dashboard/SettingsAnnouncements.jsx | 2 +- src/pages/Setting/Dashboard/SettingsFAQ.jsx | 2 +- .../Setting/Dashboard/SettingsUptimeKuma.jsx | 2 +- src/pages/Setting/Drawing/SettingsDrawing.jsx | 13 +- .../Setting/Model/SettingClaudeModel.jsx | 30 +- .../Setting/Model/SettingGeminiModel.jsx | 26 +- .../Setting/Model/SettingGlobalModel.jsx | 8 +- .../Setting/Model/SettingModelCategory.jsx | 12 +- src/pages/Setting/Model/SettingVideoModel.jsx | 3 +- .../Operation/SettingsExperienceCenter.jsx | 51 +- .../Setting/Operation/SettingsFallback.jsx | 4 +- .../Setting/Operation/SettingsGeneral.jsx | 6 +- .../Setting/Operation/SettingsLanguage.jsx | 4 +- src/pages/Setting/Operation/SettingsLog.jsx | 4 +- .../Setting/Payment/SettingsPaymentAlipay.jsx | 23 +- .../Payment/SettingsPaymentGatewayCreem.jsx | 2 +- .../Payment/SettingsPaymentGatewayPayPal.jsx | 41 +- .../Payment/SettingsPaymentGatewayStripe.jsx | 40 +- .../Setting/Payment/SettingsPaymentWechat.jsx | 23 +- src/pages/Setting/Ratio/ModelCostSettings.jsx | 31 +- .../Ratio/ModelOfficialPriceSettings.jsx | 3 +- src/pages/Setting/Ratio/UpstreamRatioSync.jsx | 13 +- .../Setting/WeyAi/SettingsWeyAiContent.jsx | 8 +- .../SkillMarket/view/SkillDetailDrawer.jsx | 5 +- src/pages/Subscription/index.jsx | 7 +- .../Tutorial/components/VideoTutorial.jsx | 5 +- src/pages/Tutorial/index.jsx | 93 +- src/pages/UserCenter/Invite.jsx | 13 +- src/pages/UserCenter/Invoice.jsx | 19 +- src/pages/WebsiteSettings/ArticleEditor.jsx | 12 +- src/pages/WebsiteSettings/InsightsPanel.jsx | 30 +- src/pages/WeyAiDownload/index.jsx | 5 +- test/unit/i18n-render-regressions.test.js | 182 + test/unit/model-local-pagination.test.js | 1 + 146 files changed, 16591 insertions(+), 11007 deletions(-) create mode 100644 src/i18n/technicalText.js create mode 100644 test/unit/i18n-render-regressions.test.js diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 43dc9810..8047cfdb 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,6 +1,6 @@ # 变更记录(CHANGELOG) -> 状态:有效(持续追加) · 更新:2026-11-16 · 版本:v3.1 +> 状态:有效(持续追加) · 更新:2026-11-17 · 版本:v3.2 对现状仍有影响的功能与修复记录,按日期倒序。改造、迁移、优化等一次性过程不在此记录。 @@ -8,6 +8,16 @@ **记录规则**:每条写“范围、变更、影响、回滚、关联”五项;回滚优先 `git revert <提交>`,提交含多项改动时按文件还原(`git checkout <提交>^ -- <文件>`),不整仓 reset。本文不作为规则依据。 +## 2026-11-17 + +### 修复 · 九语言翻译覆盖与国际化检查 + +- **范围**:`src/i18n/locales/` 九份语言包、相关页面与组件文案、价格说明及国际化回归测试。 +- **变更**:补齐中文引用键与八种目标语言缺项,补译法语、俄语历史空值;将硬编码界面文案接入翻译,将拼句改为整句插值或 `Trans`,保留链接、强调与换行;固定品牌、协议示例和单位集中维护。修复价格说明、折扣和 PayPal 嵌套翻译的插值参数,并将语言覆盖回归扩大至全部九语种。 +- **影响**:保持接口、权限、业务触发条件及语言开放范围;补译使用机器初译与结构检查,尚未完成全量母语校审。技术示例、品牌、货币、变量与组件标签保留原意,验证证据位于忽略目录 `report/i18n-fix/`。 +- **回滚**:按本次文件差异还原语言包、文案调用、固定技术文字模块及对应测试,保留原有工作区修改;无需数据迁移。 +- **关联**:`i18next.config.js`、`src/i18n/locale-coverage.test.js`、`test/unit/i18n-render-regressions.test.js`。 + ## 2026-11-16 ### 修复 · 筛选卡纯色背景、模型名称搜索与三中心表格固定列 diff --git a/src/components/analytics/ChannelConsumption.jsx b/src/components/analytics/ChannelConsumption.jsx index 06f22c72..7d44aea2 100644 --- a/src/components/analytics/ChannelConsumption.jsx +++ b/src/components/analytics/ChannelConsumption.jsx @@ -17,6 +17,7 @@ along with this program. If not, see . For commercial licensing, please contact support@quantumnous.com */ +import { I18N_TECHNICAL_TEXT } from '../../i18n/technicalText.js'; import React, { useState } from 'react'; import { Card, Table, Progress } from '@/components/ui'; import { renderQuota } from '../../helpers'; @@ -131,7 +132,7 @@ const ChannelConsumption = ({ data, title, icon, t, embedded = false }) => { {icon} {title} - TOP {data.length} + {I18N_TECHNICAL_TEXT.TOP} {data.length} ) diff --git a/src/components/analytics/RiskControlBanLogs.jsx b/src/components/analytics/RiskControlBanLogs.jsx index 6c26f17b..ae5ab0f9 100644 --- a/src/components/analytics/RiskControlBanLogs.jsx +++ b/src/components/analytics/RiskControlBanLogs.jsx @@ -17,6 +17,7 @@ along with this program. If not, see . For commercial licensing, please contact support@quantumnous.com */ +import { Trans } from 'react-i18next'; import React, { useState } from 'react'; import { Table, @@ -176,7 +177,11 @@ const RiskControlBanLogs = ({
- {t('共')} {banLogTotal || 0} {t('条')} + - - - + + + {tools.map(([name, Icon, command, selected = false]) => (
diff --git a/src/components/layout/headerbar/NewYearButton.jsx b/src/components/layout/headerbar/NewYearButton.jsx index 25dd5f3e..dea03813 100644 --- a/src/components/layout/headerbar/NewYearButton.jsx +++ b/src/components/layout/headerbar/NewYearButton.jsx @@ -17,6 +17,7 @@ along with this program. If not, see . For commercial licensing, please contact support@quantumnous.com */ +import { I18N_TECHNICAL_TEXT } from '../../../i18n/technicalText.js'; import React from 'react'; import { Button as AntButton } from 'antd'; import { Dropdown } from '@/components/ui'; @@ -51,7 +52,11 @@ const NewYearButton = ({ isNewYear, t }) => { > 🎉} + icon={ + + {I18N_TECHNICAL_TEXT.CELEBRATION_ICON} + + } aria-label={t('新年快乐')} className='ui-header-icon-action' /> diff --git a/src/components/playground/ChatArea.jsx b/src/components/playground/ChatArea.jsx index 330f4c25..7fc6941b 100644 --- a/src/components/playground/ChatArea.jsx +++ b/src/components/playground/ChatArea.jsx @@ -17,6 +17,7 @@ along with this program. If not, see . For commercial licensing, please contact support@quantumnous.com */ +import { I18N_TECHNICAL_TEXT } from '../../i18n/technicalText.js'; import { EyeOff as ActionEyeOff, Eye as ActionEye, @@ -909,7 +910,7 @@ const ChatArea = ({ className='flex items-center gap-1.5 px-3 py-1.5 rounded-full bg-brand/95 dark:bg-brand-deep/30 backdrop-blur-sm border border-brand/80 dark:border-brand-deep/60 shadow-md text-xs text-brand-deep dark:text-brand-from hover:bg-brand/95 dark:hover:bg-brand-deep/50 transition' aria-label={t('查看对话历史摘要')} > - 📝 + {I18N_TECHNICAL_TEXT.NOTE_ICON} {t('历史已压缩,点击查看摘要')} diff --git a/src/components/playground/CodeViewer.jsx b/src/components/playground/CodeViewer.jsx index e005fa35..04569f92 100644 --- a/src/components/playground/CodeViewer.jsx +++ b/src/components/playground/CodeViewer.jsx @@ -17,6 +17,7 @@ along with this program. If not, see . For commercial licensing, please contact support@quantumnous.com */ +import { I18N_TECHNICAL_TEXT } from '../../i18n/technicalText.js'; import { Copy as ActionCopy, ChevronUp as ActionChevronUp, @@ -344,13 +345,13 @@ const CodeViewer = ({ content, title, language = 'json' }) => { - (+ + {I18N_TECHNICAL_TEXT.ADDITIONAL_TOKENS_PREFIX} {Math.round( (contentMetrics.length - PERFORMANCE_CONFIG.PREVIEW_LENGTH) / 1000, )} - K) + {I18N_TECHNICAL_TEXT.THOUSAND_TOKENS_SUFFIX} )} diff --git a/src/components/playground/CustomInputRender.jsx b/src/components/playground/CustomInputRender.jsx index 083ca35c..3a537193 100644 --- a/src/components/playground/CustomInputRender.jsx +++ b/src/components/playground/CustomInputRender.jsx @@ -17,6 +17,7 @@ along with this program. If not, see . For commercial licensing, please contact support@quantumnous.com */ +import { I18N_TECHNICAL_TEXT } from '../../i18n/technicalText.js'; import { AlertTriangle as ActionAlertTriangle, RotateCw as ActionRotateCw, @@ -274,7 +275,8 @@ const AttachmentChip = ({ file, onRemove, onRestore, onRetry, t }) => { {isUploading ? ( - {Math.round((file.progress || 0) * 100)}% · {formatBytes(file.size)} + {Math.round((file.progress || 0) * 100)} + {I18N_TECHNICAL_TEXT.PERCENT_SEPARATOR} {formatBytes(file.size)} ) : isFailed ? ( diff --git a/src/components/playground/CustomRequestEditor.jsx b/src/components/playground/CustomRequestEditor.jsx index cdbd1d3f..b0a83140 100644 --- a/src/components/playground/CustomRequestEditor.jsx +++ b/src/components/playground/CustomRequestEditor.jsx @@ -17,6 +17,7 @@ along with this program. If not, see . For commercial licensing, please contact support@quantumnous.com */ +import { I18N_TECHNICAL_TEXT } from '../../i18n/technicalText.js'; import { Edit as ActionEdit } from '@/components/common/icons/ActionIcons'; import { useEffectEvent } from '../../hooks/common/useEffectEvent'; import React, { useState, useEffect } from 'react'; @@ -184,7 +185,7 @@ const CustomRequestEditor = ({