fix(i18n): 补齐九语翻译并修复国际化检查

补齐历史缺译并统一整句插值。九语覆盖 100%,静态检查及 713 项单测通过。
This commit is contained in:
zhanjunhao
2026-11-17 14:10:25 +08:00
parent ef93825c07
commit e7a7541b2b
146 changed files with 16591 additions and 11007 deletions
+5 -3
View File
@@ -16,6 +16,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { I18N_TECHNICAL_TEXT } from '../../i18n/technicalText.js';
import {
RefreshCw as ActionRefreshCw,
Plus as ActionPlus,
@@ -565,7 +567,7 @@ const OrgConnectors = ({ orgId }) => {
<TextArea
value={form.allowed_hosts}
onChange={(value) => setForm({ ...form, allowed_hosts: value })}
placeholder='api.example.com'
placeholder={I18N_TECHNICAL_TEXT.API_EXAMPLE_COM}
/>
</label>
<label>
@@ -584,7 +586,7 @@ const OrgConnectors = ({ orgId }) => {
<TextArea
value={form.allowed_cidrs}
onChange={(value) => setForm({ ...form, allowed_cidrs: value })}
placeholder={'10.20.0.0/16\nfd00:1::/48'}
placeholder={I18N_TECHNICAL_TEXT.CONNECTOR_CIDR_EXAMPLE}
/>
<span className='org-connector-note'>
{t(
@@ -598,7 +600,7 @@ const OrgConnectors = ({ orgId }) => {
autosize
value={form.config}
onChange={(value) => setForm({ ...form, config: value })}
placeholder='{"project_ids":["123"],"path_prefixes":["src/"]}'
placeholder={I18N_TECHNICAL_TEXT.CONNECTOR_SCOPE_EXAMPLE}
/>
</label>
</div>
+8 -2
View File
@@ -16,6 +16,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { I18N_TECHNICAL_TEXT } from '../../i18n/technicalText.js';
import {
Search as ActionSearch,
RefreshCw as ActionRefreshCw,
@@ -227,9 +229,13 @@ const MemberUsageSheet = ({ visible, onClose, member, orgId, t }) => {
width: 120,
render: (_, record) => (
<div className='text-xs text-gray-600 dark:text-gray-400'>
<span title='Prompt'>{record.prompt_tokens || 0}</span>
<span title={I18N_TECHNICAL_TEXT.PROMPT}>
{record.prompt_tokens || 0}
</span>
<span className='mx-1 text-gray-300 dark:text-gray-600'>/</span>
<span title='Completion'>{record.completion_tokens || 0}</span>
<span title={I18N_TECHNICAL_TEXT.COMPLETION}>
{record.completion_tokens || 0}
</span>
</div>
),
},
+8 -3
View File
@@ -16,6 +16,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { I18N_TECHNICAL_TEXT } from '../../i18n/technicalText.js';
import { RefreshCw as ActionRefreshCw } from '@/components/common/icons/ActionIcons';
import React, { useCallback, useEffect, useMemo, useState } from 'react';
import {
@@ -461,7 +463,9 @@ const OrgEffectiveness = ({ orgId, canManagePolicy, canManageSkills }) => {
{(data.alerts || []).map((row) => (
<article key={row.id}>
<div>
<strong>Skill #{row.dimension_id}</strong>
<strong>
{t('技能 #{{id}}', { id: row.dimension_id })}
</strong>
<Tag color={row.status === 'open' ? 'red' : 'green'}>
{row.status}
</Tag>
@@ -610,9 +614,10 @@ const OrgEffectiveness = ({ orgId, canManagePolicy, canManageSkills }) => {
<strong>{row.name}</strong>
<Tag>{row.status}</Tag>
</div>
<span>Skill #{row.skill_id}</span>
<span>{t('技能 #{{id}}', { id: row.skill_id })}</span>
<span>
A / B: {row.version_a_id} / {row.version_b_id}
{I18N_TECHNICAL_TEXT.AB_METRICS_PREFIX} {row.version_a_id} /{' '}
{row.version_b_id}
</span>
<span>
{t('目标样本')}: {row.target_sample}
+3 -1
View File
@@ -16,6 +16,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { I18N_TECHNICAL_TEXT } from '../../i18n/technicalText.js';
import {
RefreshCw as ActionRefreshCw,
Plus as ActionPlus,
@@ -1349,7 +1351,7 @@ const OrgKnowledge = ({ orgId, canAuditContent = false }) => {
<div className='knowledge-eyebrow'>
<ShieldCheck size={15} />
<span>{t('企业可信知识层')}</span>
<span className='knowledge-beta'>BETA</span>
<span className='knowledge-beta'>{I18N_TECHNICAL_TEXT.BETA}</span>
</div>
<h1>{t('企业知识')}</h1>
<p>
+6 -2
View File
@@ -16,6 +16,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { I18N_TECHNICAL_TEXT } from '../../i18n/technicalText.js';
import {
Search as ActionSearch,
Download as ActionDownload,
@@ -638,8 +640,10 @@ const OrgLogs = ({ orgId, orgRole, isDeptManager = false }) => {
width: 165,
render: (_, record) => (
<span className='oc-number'>
<span title='Prompt'>{record.prompt_tokens || 0}</span>{' '}
<span className='oc-muted' title='Completion'>
<span title={I18N_TECHNICAL_TEXT.PROMPT}>
{record.prompt_tokens || 0}
</span>{' '}
<span className='oc-muted' title={I18N_TECHNICAL_TEXT.COMPLETION}>
/ {record.completion_tokens || 0}
</span>
</span>
+12 -15
View File
@@ -812,10 +812,9 @@ const OrgMembers = ({
{/* 成员配额设置 Modal */}
<OrgModal
title={
t('设置成员配额上限') +
(quotaMemberName ? ` - ${quotaMemberName}` : '')
}
title={t('设置成员配额上限{{value}}', {
value: quotaMemberName ? ` - ${quotaMemberName}` : '',
})}
visible={quotaModalVisible}
onOk={handleQuotaLimitSave}
onCancel={() => setQuotaModalVisible(false)}
@@ -875,10 +874,9 @@ const OrgMembers = ({
{/* 成员模型限制 Modal */}
<OrgModal
title={
t('设置成员模型限制') +
(modelLimitsMemberName ? ` - ${modelLimitsMemberName}` : '')
}
title={t('设置成员模型限制{{value}}', {
value: modelLimitsMemberName ? ` - ${modelLimitsMemberName}` : '',
})}
visible={modelLimitsModalVisible}
onOk={handleModelLimitsSave}
onCancel={() => setModelLimitsModalVisible(false)}
@@ -923,10 +921,9 @@ const OrgMembers = ({
{/* 成员可调用分组 Modal */}
<OrgModal
title={
t('设置成员可调用分组') +
(groupsMemberName ? ` - ${groupsMemberName}` : '')
}
title={t('设置成员可调用分组{{value}}', {
value: groupsMemberName ? ` - ${groupsMemberName}` : '',
})}
visible={groupsModalVisible}
onOk={handleGroupsSave}
onCancel={() => setGroupsModalVisible(false)}
@@ -966,9 +963,9 @@ const OrgMembers = ({
{/* 管理员细粒度权限 Modal(owner 对 admin 下放) */}
<OrgModal
title={
t('设置管理员权限') + (permMemberName ? ` - ${permMemberName}` : '')
}
title={t('设置管理员权限{{value}}', {
value: permMemberName ? ` - ${permMemberName}` : '',
})}
visible={permModalVisible}
onOk={handlePermissionsSave}
onCancel={() => setPermModalVisible(false)}
+11 -5
View File
@@ -16,6 +16,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { Trans } from 'react-i18next';
import React, { useEffect, useMemo, useState } from 'react';
import { Button, Card, Empty, Tag, Typography } from 'antd';
import { Cable, LockKeyhole } from 'lucide-react';
@@ -183,11 +184,16 @@ const OrgMyConnectors = ({ orgId }) => {
<div className='org-capability-confirmation'>
<LockKeyhole size={14} aria-hidden='true' />
<Typography.Text type='secondary'>
{t('确认策略')}:{' '}
{t(
confirmationLabels[item.grant.confirmation_policy] ||
item.grant.confirmation_policy,
)}
<Trans
t={t}
i18nKey='确认策略: {{label}}'
values={{
label: t(
confirmationLabels[item.grant.confirmation_policy] ||
item.grant.confirmation_policy,
),
}}
/>
</Typography.Text>
</div>
<div className='org-capability-card-footer'>
+11 -2
View File
@@ -16,6 +16,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { Trans } from 'react-i18next';
import { useEffectEvent } from '../../hooks/common/useEffectEvent';
import React, { useCallback, useContext, useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
@@ -353,8 +355,15 @@ const OrgPersonalSettings = ({ orgId }) => {
/>
<div className='oc-ps-quota-meta'>
<span>
{t('已用')} {renderQuota(usedQuota)} / {t('总额')}{' '}
{renderQuota(quotaLimit)}({usedPct}%)
<Trans
t={t}
i18nKey='已用 {{value}} / 总额 {{value2}}({{usedPct}}%)'
values={{
value: renderQuota(usedQuota),
value2: renderQuota(quotaLimit),
usedPct: usedPct,
}}
/>
</span>
{isPeriodic && (
<span>{quotaPeriodHint(t, myQuota.quota_period)}</span>
+3 -1
View File
@@ -16,6 +16,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { I18N_TECHNICAL_TEXT } from '../../i18n/technicalText.js';
import {
FileCheck2 as ActionFileCheck2,
RotateCcw as ActionRotateCcw,
@@ -542,7 +544,7 @@ const OrgPrivateSkills = ({ orgId }) => {
))}
<TextArea
rows={10}
placeholder='Skill Markdown'
placeholder={I18N_TECHNICAL_TEXT.SKILL_MARKDOWN}
value={form.body}
onChange={(body) => setForm({ ...form, body })}
/>
+5 -1
View File
@@ -16,6 +16,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { I18N_TECHNICAL_TEXT } from '../../i18n/technicalText.js';
import { Check as ActionCheck } from '@/components/common/icons/ActionIcons';
import React, { useEffect, useState, useCallback, useMemo } from 'react';
import { timestamp2string } from '../../helpers/utils';
@@ -786,7 +788,9 @@ const OrgRecharge = ({ orgId }) => {
maximumFractionDigits: 2,
})}
</b>
{payWay === 'paypal' && <span> USD</span>}
{payWay === 'paypal' && (
<span> {I18N_TECHNICAL_TEXT.USD}</span>
)}
</>
) : (
'-'
+1 -1
View File
@@ -203,7 +203,7 @@ const OrgResolver = ({
className='text-gray-400 flex-shrink-0'
/>
<span className='text-sm font-medium text-gray-900 dark:text-white truncate'>
{org.name || t('企业') + ' #' + org.id}
{org.name || t('企业 #{{id}}', { id: org.id })}
</span>
</div>
<span className='text-xs font-medium text-amber-600 dark:text-amber-400 flex-shrink-0'>
+5 -1
View File
@@ -16,6 +16,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { I18N_TECHNICAL_TEXT } from '../../i18n/technicalText.js';
import {
ChevronDown as ActionChevronDown,
ChevronRight as ActionChevronRight,
@@ -573,7 +575,9 @@ const OrgSidebar = ({
{item.text}
</span>
{item.beta && (
<span className='ui-org-beta'>BETA</span>
<span className='ui-org-beta'>
{I18N_TECHNICAL_TEXT.BETA}
</span>
)}
</>
)}
@@ -16,6 +16,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { Trans } from 'react-i18next';
import {
ChevronRight as ActionChevronRight,
ChevronDown as ActionChevronDown,
@@ -212,7 +213,11 @@ const DeptNode = memo(({ data, selected }) => {
</div>
<div className='mt-1.5 flex items-center gap-2 flex-wrap'>
<Text type='tertiary' size='small'>
{t('子部门')} {childCount} · {t('排序')} {dept.sort || 0}
<Trans
t={t}
i18nKey='子部门 {{childCount}} · 排序 {{value}}'
values={{ childCount: childCount, value: dept.sort || 0 }}
/>
</Text>
<Tooltip content={t('查看直属成员')}>
<button
@@ -16,6 +16,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { Trans } from 'react-i18next';
import React, {
useCallback,
useEffect,
@@ -420,7 +421,11 @@ const OrgDsPolicy = ({ orgId, isSuperAdmin, refreshVersion = 0 }) => {
disabled={fieldsLocked}
/>
<p className='text-xs text-gray-400 dark:text-gray-500 mt-1'>
{t(field.hint)} {t('企业策略只能保持或收紧平台安全基线。')}
<Trans
t={t}
i18nKey='{{label}} 企业策略只能保持或收紧平台安全基线。'
values={{ label: t(field.hint) }}
/>
</p>
</div>
))}
@@ -365,7 +365,7 @@ const OrgDsRules = ({ orgId, isSuperAdmin }) => {
<Input
value={draft.pattern}
onChange={(v) => setDraft({ ...draft, pattern: v })}
placeholder={t('例如') + ' EMP[0-9]{6}'}
placeholder={t('例如 EMP[0-9]{6}')}
/>
</div>
<div>