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

补齐页面缺译,统一动态文案的整句插值方式。
This commit is contained in:
zhanjunhao
2026-11-17 14:10:25 +08:00
parent ef3f405190
commit 67969a041d
146 changed files with 16591 additions and 11007 deletions
+25 -19
View File
@@ -1019,11 +1019,11 @@ function renderPriceSimpleCore({
const parts = [];
// base: model ratio
parts.push(i18next.t('模型: {{ratio}}'));
parts.push(i18next.t('模型: {{ratio}}', { ratio: modelRatio }));
// cache part (label differs when with image)
if (shouldShowCache) {
parts.push(i18next.t('缓存: {{cacheRatio}}'));
parts.push(i18next.t('缓存: {{cacheRatio}}', { cacheRatio }));
}
if (hasSplitCacheCreation) {
@@ -1031,37 +1031,43 @@ function renderPriceSimpleCore({
parts.push(
i18next.t(
'缓存创建: 5m {{cacheCreationRatio5m}} / 1h {{cacheCreationRatio1h}}',
{ cacheCreationRatio5m, cacheCreationRatio1h },
),
);
} else if (shouldShowCacheCreation5m) {
parts.push(i18next.t('缓存创建: 5m {{cacheCreationRatio5m}}'));
parts.push(
i18next.t('缓存创建: 5m {{cacheCreationRatio5m}}', {
cacheCreationRatio5m,
}),
);
} else if (shouldShowCacheCreation1h) {
parts.push(i18next.t('缓存创建: 1h {{cacheCreationRatio1h}}'));
parts.push(
i18next.t('缓存创建: 1h {{cacheCreationRatio1h}}', {
cacheCreationRatio1h,
}),
);
}
} else if (shouldShowLegacyCacheCreation) {
parts.push(i18next.t('缓存创建: {{cacheCreationRatio}}'));
parts.push(
i18next.t('缓存创建: {{cacheCreationRatio}}', { cacheCreationRatio }),
);
}
// image part
if (image) {
parts.push(i18next.t('图片输入: {{imageRatio}}'));
parts.push(i18next.t('图片输入: {{imageRatio}}', { imageRatio }));
}
parts.push(`{{ratioType}}: {{groupRatio}}`);
let result = i18next.t(parts.join(' * '), {
ratio: modelRatio,
ratioType: ratioLabel,
groupRatio: finalGroupRatio,
cacheRatio: cacheRatio,
cacheCreationRatio: cacheCreationRatio,
cacheCreationRatio5m: cacheCreationRatio5m,
cacheCreationRatio1h: cacheCreationRatio1h,
imageRatio: imageRatio,
});
parts.push(
i18next.t('{{ratioType}}: {{groupRatio}}', {
ratioType: ratioLabel,
groupRatio: finalGroupRatio,
}),
);
let result = parts.join(' * ');
if (isSystemPromptOverride) {
result += '\n\r' + i18next.t('系统提示覆盖');
result += `\n\r${i18next.t('系统提示覆盖')}`;
}
return result;
+7 -13
View File
@@ -581,20 +581,14 @@ export const stripHistoryAttachments = (messages) => {
counts.get(n) > 1 ? `${n}×${counts.get(n)}` : n,
);
if (grouped.length <= 5) {
return (
'\n\n' +
i18next.t('[已发送附件: {{names}}]', {
names: grouped.join(', '),
})
);
return `\n\n${i18next.t('[已发送附件: {{names}}]', {
names: grouped.join(', '),
})}`;
}
return (
'\n\n' +
i18next.t('[已发送附件: {{names}} 等 {{total}} 个]', {
names: grouped.slice(0, 5).join(', '),
total: names.length,
})
);
return `\n\n${i18next.t('[已发送附件: {{names}} 等 {{total}} 个]', {
names: grouped.slice(0, 5).join(', '),
total: names.length,
})}`;
};
// 白名单识别"要剥离的附件 part",其余 part(text / 未来可能的 audio / video 等)一律保留,