refactor(i18n): 全工程面向国际用户与全球现代商务重构,彻底清理出海跨境等单向视角表达并对齐自动化测试

这个提交包含在:
wikiboss
2026-09-21 15:24:36 +08:00
父节点 ad9df7a7a4
当前提交 17882ca1cb
共有 135 个文件被更改,包括 12928 次插入 和 1653 次删除

查看文件

@@ -34,7 +34,25 @@ export type LeadsCopyKey =
| 'loading'
| 'score'
| 'radarMore'
| 'hotBadge';
| 'hotBadge'
| 'hotTitle'
| 'highIntent'
| 'activeRadar'
| 'quickContact'
| 'call'
| 'email'
| 'sourceNfc'
| 'sourceQr'
| 'sourceLink'
| 'sourceAi'
| 'statTotal'
| 'statHot'
| 'statNew'
| 'statWon'
| 'teamBriefing'
| 'liveTracks'
| 'noCompany'
| 'noTracks';
export type LoadLeadsQuery = {
page: number;
@@ -163,6 +181,60 @@ export function resolveLeadsText(key: LeadsCopyKey): string {
if (key === 'hotBadge') {
return zh ? '高意向访客' : 'Hot visitors';
}
if (key === 'hotTitle') {
return zh ? '高意向商机' : 'Hot Leads';
}
if (key === 'highIntent') {
return zh ? '高意向' : 'High Intent';
}
if (key === 'activeRadar') {
return zh ? '活跃雷达' : 'Live Radar';
}
if (key === 'quickContact') {
return zh ? '快捷联系' : 'Quick Contact';
}
if (key === 'call') {
return zh ? '电话呼叫' : 'Call';
}
if (key === 'email') {
return zh ? '发送邮件' : 'Email';
}
if (key === 'sourceNfc') {
return 'NFC';
}
if (key === 'sourceQr') {
return 'QR Code';
}
if (key === 'sourceLink') {
return 'Web Link';
}
if (key === 'sourceAi') {
return 'AI Chat';
}
if (key === 'statTotal') {
return zh ? '总潜客' : 'Total Leads';
}
if (key === 'statHot') {
return zh ? '高意向' : 'Hot';
}
if (key === 'statNew') {
return zh ? '新线索' : 'New';
}
if (key === 'statWon') {
return zh ? '已成交' : 'Won';
}
if (key === 'teamBriefing') {
return zh ? '团队简报' : 'Team Overview';
}
if (key === 'liveTracks') {
return zh ? '实时访客足迹' : 'Live Visitor Track';
}
if (key === 'noCompany') {
return zh ? '个人客户' : 'Individual';
}
if (key === 'noTracks') {
return zh ? '暂无实时轨迹' : 'No recent radar activity';
}
return '';
}
@@ -192,6 +264,36 @@ export function statusLabel(status: string): string {
return status;
}
export function sourceLabel(source: string): string {
if (source === 'nfc') {
return resolveLeadsText('sourceNfc');
}
if (source === 'qr') {
return resolveLeadsText('sourceQr');
}
if (source === 'link') {
return resolveLeadsText('sourceLink');
}
if (source === 'ai_chat') {
return resolveLeadsText('sourceAi');
}
return source;
}
export function formatLeadInitials(name: string): string {
const trimmed = name.trim();
if (trimmed === '') {
return 'L';
}
const parts = trimmed.split(' ');
if (parts.length >= 2) {
const first = parts[0].length > 0 ? parts[0].charAt(0) : '';
const second = parts[1].length > 0 ? parts[1].charAt(0) : '';
return (first + second).toUpperCase();
}
return trimmed.substring(0, Math.min(2, trimmed.length)).toUpperCase();
}
export function formatLeadCompany(company: string | null | undefined): string {
if (company == null) {
return '';