feat: 增加管理端多语言与多模块界面国际化支持

This commit is contained in:
2026-05-19 09:11:55 +08:00
parent 49a4caf01e
commit 1b1dfc92ab
110 changed files with 4053 additions and 1308 deletions

View File

@@ -1,71 +1,49 @@
/**
* 运营配置子导航与面包屑的单一数据源。
* 新增配置页:在此追加条目,并增加 `app/admin/(shell)/config/.../page.tsx`
* Single source of truth for config sub-navigation and breadcrumb routes.
* Add new config pages here and create the matching `app/admin/(shell)/config/.../page.tsx`.
*/
export type ConfigNavGroup = {
id: string;
label: string;
items: readonly {
href: string;
title: string;
description: string;
key: string;
}[];
};
export const CONFIG_NAV_GROUPS: readonly ConfigNavGroup[] = [
{
id: "betting",
label: "投注与展示",
items: [
{
href: "/admin/config/plays",
title: "玩法与限额",
description: "目录开关、单玩法限额、版本发布",
key: "plays",
},
{
href: "/admin/config/odds",
title: "赔率",
description: "按玩法与奖级维护乘数与币种",
key: "odds",
},
{
href: "/admin/config/rebate",
title: "佣金 / 回水",
description: "从赔率草稿批量调整回水比例",
key: "rebate",
},
],
},
{
id: "risk_wallet",
label: "风控与资金",
items: [
{
href: "/admin/config/risk-cap",
title: "赔付封顶",
description: "按号码维度的封顶版本",
key: "risk-cap",
},
{
href: "/admin/config/wallet",
title: "钱包阈值",
description: "转入转出上下限(系统设置)",
key: "wallet",
},
],
},
] as const;
const CONFIG_ROUTE_LABEL_ENTRIES: readonly [string, string][] = [
["plays", "玩法与限额"],
["odds", "赔率"],
["rebate", "佣金 / 回水"],
["risk-cap", "赔付封顶"],
["wallet", "钱包阈值"],
];
/** 面包屑第三段 slug → 中文 */
export const CONFIG_ROUTE_LABELS: Readonly<Record<string, string>> = Object.fromEntries(
CONFIG_ROUTE_LABEL_ENTRIES,
) as Readonly<Record<string, string>>;
export function flattenConfigNavHrefs(): string[] {
const out: string[] = [];
for (const g of CONFIG_NAV_GROUPS) {