refactor: 完成全站国际化改造,统一多语言支持
此提交完成了全项目的国际化适配: 1. 新增多语言翻译文件与基础配置 2. 替换所有硬编码文本为i18n调用 3. 优化语言切换与文档语言同步逻辑 4. 重构部分业务逻辑以支持动态翻译 5. 移除过时代码与硬编码配置
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
export type DrawStatusHud = {
|
||||
label: string;
|
||||
labelKey: string;
|
||||
/** Tailwind 颜色类:状态圆点 */
|
||||
dotClass: string;
|
||||
/** 文案条(如「距封盘」) */
|
||||
@@ -18,26 +18,26 @@ export function isHallSealedCountdownUi(status: string): boolean {
|
||||
export function drawStatusHud(status: string): DrawStatusHud {
|
||||
switch (status) {
|
||||
case "pending":
|
||||
return { label: "未开始", dotClass: "bg-muted-foreground", countdownKind: "none" };
|
||||
return { labelKey: "draw.status.pending", dotClass: "bg-muted-foreground", countdownKind: "none" };
|
||||
case "open":
|
||||
return { label: "可下注", dotClass: "bg-emerald-500", countdownKind: "close" };
|
||||
return { labelKey: "draw.status.open", dotClass: "bg-emerald-500", countdownKind: "close" };
|
||||
case "closing":
|
||||
return { label: "已封盘", dotClass: "bg-rose-500", countdownKind: "draw" };
|
||||
return { labelKey: "draw.status.closing", dotClass: "bg-rose-500", countdownKind: "draw" };
|
||||
case "closed":
|
||||
return { label: "待开奖", dotClass: "bg-amber-500", countdownKind: "draw" };
|
||||
return { labelKey: "draw.status.closed", dotClass: "bg-amber-500", countdownKind: "draw" };
|
||||
case "drawing":
|
||||
return { label: "开奖中", dotClass: "bg-sky-500", countdownKind: "none" };
|
||||
return { labelKey: "draw.status.drawing", dotClass: "bg-sky-500", countdownKind: "none" };
|
||||
case "review":
|
||||
return { label: "待审核", dotClass: "bg-violet-500", countdownKind: "none" };
|
||||
return { labelKey: "draw.status.review", dotClass: "bg-violet-500", countdownKind: "none" };
|
||||
case "cooldown":
|
||||
return { label: "冷静期", dotClass: "bg-cyan-500", countdownKind: "cooldown" };
|
||||
return { labelKey: "draw.status.cooldown", dotClass: "bg-cyan-500", countdownKind: "cooldown" };
|
||||
case "settling":
|
||||
return { label: "结算中", dotClass: "bg-blue-600", countdownKind: "none" };
|
||||
return { labelKey: "draw.status.settling", dotClass: "bg-blue-600", countdownKind: "none" };
|
||||
case "settled":
|
||||
return { label: "已结算", dotClass: "bg-muted-foreground", countdownKind: "none" };
|
||||
return { labelKey: "draw.status.settled", dotClass: "bg-muted-foreground", countdownKind: "none" };
|
||||
case "cancelled":
|
||||
return { label: "已取消", dotClass: "bg-muted-foreground", countdownKind: "none" };
|
||||
return { labelKey: "draw.status.cancelled", dotClass: "bg-muted-foreground", countdownKind: "none" };
|
||||
default:
|
||||
return { label: status, dotClass: "bg-muted-foreground", countdownKind: "none" };
|
||||
return { labelKey: status, dotClass: "bg-muted-foreground", countdownKind: "none" };
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user