feat(i18n): 将前端用户可见中文硬编码改为四语言

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
sophieandCursor committed 2026-07-30 14:39:16 +08:00
1 parent dce915ea30
commit ac7b53a523
105 files changed
+2928 -647

No files matched your search

@@ -23,6 +23,7 @@ export interface ShippingParseReviewContext {
saveLocalMessageToBackend: (msg: ChatMessage, userQuery?: string) => Promise<void>;
refreshShippingActions: () => Promise<void>;
msg: { warning: (text: string) => void };
t: (key: string, params?: Record<string, unknown>) => string;
}
/**
@@ -63,12 +64,12 @@ export function createShippingParseReviewHandlers(ctx: ShippingParseReviewContex
payload.saving = true;
const taskId = String(payload.taskId || '').trim().toUpperCase();
try {
await updateWorkspaceShippingNoticeFields(taskId, fields, '聊天区订单表修订');
await updateWorkspaceShippingNoticeFields(taskId, fields, ctx.t('chat.shippingNoticeToast.auditCommentHeaderEdit'));
await syncShippingParseReviewCard(taskId);
await ctx.refreshShippingActions();
return true;
} catch (e: unknown) {
ctx.msg.warning(e instanceof Error ? e.message : '更新解析结果失败');
ctx.msg.warning(e instanceof Error ? e.message : ctx.t('chat.shippingNoticeToast.updateParseFailed'));
return false;
} finally {
const current = getShippingParseReviewPayload(msgObj);
@@ -86,12 +87,12 @@ export function createShippingParseReviewHandlers(ctx: ShippingParseReviewContex
payload.saving = true;
const taskId = String(payload.taskId || '').trim().toUpperCase();
try {
await updateWorkspaceShippingNoticeLine(taskId, lineIndex, patch, '聊天区订单表修订');
await updateWorkspaceShippingNoticeLine(taskId, lineIndex, patch, ctx.t('chat.shippingNoticeToast.auditCommentHeaderEdit'));
await syncShippingParseReviewCard(taskId);
await ctx.refreshShippingActions();
return true;
} catch (e: unknown) {
ctx.msg.warning(e instanceof Error ? e.message : '更新解析结果失败');
ctx.msg.warning(e instanceof Error ? e.message : ctx.t('chat.shippingNoticeToast.updateParseFailed'));
return false;
} finally {
const current = getShippingParseReviewPayload(msgObj);
@@ -108,12 +109,12 @@ export function createShippingParseReviewHandlers(ctx: ShippingParseReviewContex
payload.saving = true;
const taskId = String(payload.taskId || '').trim().toUpperCase();
try {
await addWorkspaceShippingNoticeLine(taskId, line, '聊天区订单表新增行');
await addWorkspaceShippingNoticeLine(taskId, line, ctx.t('chat.shippingNoticeToast.auditCommentLineAdd'));
await syncShippingParseReviewCard(taskId);
await ctx.refreshShippingActions();
return true;
} catch (e: unknown) {
ctx.msg.warning(e instanceof Error ? e.message : '新增订单行失败');
ctx.msg.warning(e instanceof Error ? e.message : ctx.t('chat.shippingNoticeToast.addLineFailed'));
return false;
} finally {
const current = getShippingParseReviewPayload(msgObj);
@@ -130,12 +131,12 @@ export function createShippingParseReviewHandlers(ctx: ShippingParseReviewContex
payload.saving = true;
const taskId = String(payload.taskId || '').trim().toUpperCase();
try {
await removeWorkspaceShippingNoticeLine(taskId, lineIndex, '聊天区订单表删除行');
await removeWorkspaceShippingNoticeLine(taskId, lineIndex, ctx.t('chat.shippingNoticeToast.auditCommentLineDelete'));
await syncShippingParseReviewCard(taskId);
await ctx.refreshShippingActions();
return true;
} catch (e: unknown) {
ctx.msg.warning(e instanceof Error ? e.message : '删除订单行失败');
ctx.msg.warning(e instanceof Error ? e.message : ctx.t('chat.shippingNoticeToast.deleteLineFailed'));
return false;
} finally {
const current = getShippingParseReviewPayload(msgObj);