i18n(desktop): localize runtime activity titles and details to Chinese
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -41,10 +41,41 @@ function translateEventTitle(title: string) {
|
||||
"Desktop Stream Connected": "单点事件流已连接",
|
||||
"Desktop Runtime Started": "调度节点已启动",
|
||||
"Desktop Runtime Armed": "任务消费端已就绪",
|
||||
"Desktop Stream Reconnecting": "单点事件流重连中",
|
||||
"Desktop Stream Backoff": "单点事件流退避等待",
|
||||
"Heartbeat Failed": "心跳连接失败",
|
||||
"Account Sync Failed": "账号同步失败",
|
||||
"Account Unbound": "账号已解绑",
|
||||
"Specific Lease Missed": "指定任务领取失败",
|
||||
"Pull Fallback Failed": "兜底拉取失败",
|
||||
"Task Leased": "任务已领取",
|
||||
"Task Completed As Failed": "任务执行失败",
|
||||
"Task Completed As Unknown": "任务执行结果待确认",
|
||||
"Task Succeeded": "任务执行成功",
|
||||
"Task Failed": "任务执行失败",
|
||||
"Lease Extend Failed": "租约续期失败",
|
||||
"Desktop Client Token Expired": "客户端令牌已过期",
|
||||
};
|
||||
return map[title] || title;
|
||||
}
|
||||
|
||||
function translateEventDetail(detail: string) {
|
||||
const exactMap: Record<string, string> = {
|
||||
"已启动 SSE、heartbeat 和 pull fallback。": "已启动 SSE、心跳上报和兜底拉取。",
|
||||
"client heartbeat 已写回服务端。": "客户端心跳已回写到服务端。",
|
||||
};
|
||||
|
||||
return (exactMap[detail] || detail)
|
||||
.replace(/\brouting=rabbitmq-primary\b/gi, "路由:主消息队列通道")
|
||||
.replace(/\brouting=db-recovery\b/gi, "路由:数据库兜底拉取")
|
||||
.replace(/\bdesktop client\b/gi, "桌面客户端")
|
||||
.replace(/\bclient heartbeat\b/gi, "客户端心跳")
|
||||
.replace(/\bpull fallback\b/gi, "兜底拉取")
|
||||
.replace(/\bheartbeat\b/gi, "心跳上报")
|
||||
.replace(/\bClient\b/g, "客户端")
|
||||
.replace(/\bunknown_error\b/gi, "未知错误");
|
||||
}
|
||||
|
||||
function formatUid(uid: string) {
|
||||
return (uid || "").replace(/^(?:platform:)+/gi, "");
|
||||
}
|
||||
@@ -145,7 +176,7 @@ const subsystemCards = computed(() => {
|
||||
</div>
|
||||
<small>{{ formatRelativeTime(entry.at) }}</small>
|
||||
</div>
|
||||
<p>{{ entry.detail }}</p>
|
||||
<p>{{ translateEventDetail(entry.detail) }}</p>
|
||||
</article>
|
||||
</div>
|
||||
<p v-else class="empty-text" style="margin-top: 16px;">当前没有最近事件记录。</p>
|
||||
|
||||
Reference in New Issue
Block a user