feat(agents, i18n): enhance agent management and settlement features with new translations and UI updates

Added new translations for agent management and settlement features in English, Nepali, and Chinese, improving multi-language support. Updated the agents console to reflect changes in funding modes and player details, enhancing user experience. Refactored the admin permission gate to include new logic for handling bound line agents, ensuring better permission management. Additionally, streamlined the UI for agent-related pages and improved navigation to the settlement center, consolidating related functionalities for better accessibility.
This commit is contained in:
2026-06-04 18:01:05 +08:00
parent c2eac2fafc
commit 65eaeecf8c
139 changed files with 8852 additions and 1435 deletions

View File

@@ -0,0 +1,69 @@
import type { TFunction } from "i18next";
export function settlementBillStatusLabel(
status: string,
t: TFunction<"settlementCenter">,
): string {
const key = `billStatus.${status}` as const;
return t(key, { defaultValue: status });
}
export function settlementBillTypeLabel(
billType: string,
t: TFunction<["settlementCenter", "agents"]>,
): string {
if (billType === "player") {
return t("agents:settlementBills.typePlayer", { defaultValue: "玩家账单" });
}
if (billType === "agent") {
return t("agents:settlementBills.typeAgent", { defaultValue: "代理层级账单" });
}
if (billType === "adjustment") {
return t("settlementCenter:billType.adjustment", { defaultValue: "补差单" });
}
if (billType === "reversal") {
return t("settlementCenter:billType.reversal", { defaultValue: "冲正单" });
}
if (billType === "bad_debt") {
return t("settlementCenter:billType.badDebt", { defaultValue: "坏账核销" });
}
return billType;
}
export function settlementPeriodStatusLabel(
status: string,
t: TFunction<"settlementCenter">,
): string {
if (status === "open") {
return t("filters.statusOpen", { defaultValue: "进行中" });
}
if (status === "closed") {
return t("filters.statusClosed", { defaultValue: "已关账" });
}
if (status === "completed") {
return t("filters.statusCompleted", { defaultValue: "已结清" });
}
return status;
}
export function creditLedgerReasonLabel(
reason: string,
t: TFunction<"settlementCenter">,
): string {
const key = `creditLedger.reason.${reason}` as const;
return t(key, { defaultValue: reason });
}
export function settlementAdjustmentTypeLabel(
type: string,
t: TFunction<"settlementCenter">,
): string {
if (type === "bad_debt") {
return t("adjustmentType.bad_debt", { defaultValue: "坏账核销" });
}
const key = `adjustmentType.${type}` as const;
return t(key, { defaultValue: type });
}