Files
lotteryAdmin/src/lib/admin-nav-label.ts
kang b15e377187 feat(api, i18n): add agent_node_id to various admin queries and enhance multi-language support
Introduced the agent_node_id field in AdminDrawListQuery, AdminPlayerListQuery, AdminSettlementBatchListQuery, TicketItemsListQuery, and TransferOrderListQuery to improve filtering capabilities. Updated the admin-breadcrumb and admin-sidebar components to include new translations for agent-related terms in English, Nepali, and Chinese, enhancing the overall user experience and multi-language support across the admin interface.
2026-06-02 14:37:08 +08:00

40 lines
999 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import type { TFunction } from "i18next";
/** 与 {@link AdminBreadcrumb} / 侧栏共用:仅用 i18n避免 API 旧 label 作 defaultValue 导致水合不一致 */
const NAV_SEGMENT_I18N_KEYS: Record<string, string> = {
dashboard: "dashboard",
admin_users: "admin_users",
admin_roles: "admin_roles",
players: "players",
currencies: "currencies",
wallet: "wallet",
draws: "draws",
rules_plays: "rules_plays",
rules_odds: "rules_odds",
jackpot: "jackpot",
risk_cap: "risk_cap",
risk: "risk",
settlement: "settlement",
reconcile: "reconcile",
reports: "reports",
tickets: "tickets",
audit: "audit",
settings: "settings",
integration: "integration",
agents: "agents",
config: "config",
};
export function adminNavLabel(
segment: string,
t: TFunction,
apiLabel?: string | null,
): string {
const key = NAV_SEGMENT_I18N_KEYS[segment];
if (key) {
return t(`nav.${key}`, { ns: "common" });
}
return apiLabel?.trim() ? apiLabel : segment;
}