feat(i18n): enhance locale support for rebate settings and report exports

- Updated English, Nepali, and Chinese locale files to include new translations for the "apply rebate to payout" feature, enhancing clarity on its functionality.
- Added new export options for previewing CSV and Excel files in reports, improving user experience with clearer export capabilities.
- Enhanced internationalization support across multiple locales to ensure consistent messaging in the admin interface.
This commit is contained in:
2026-05-26 13:53:22 +08:00
parent a76b681828
commit 60271d87fb
17 changed files with 222 additions and 76 deletions

View File

@@ -29,6 +29,7 @@ const DRAW_KEYS = {
AUTO_SETTLEMENT: "settlement.auto_run_on_tick",
AUTO_APPROVE: "settlement.auto_approve_on_tick",
AUTO_PAYOUT: "settlement.auto_payout_on_tick",
APPLY_REBATE_TO_PAYOUT: "settlement.apply_rebate_to_payout",
} as const;
const FRONTEND_GROUP = "frontend";
@@ -45,6 +46,7 @@ interface RuntimeDraft {
autoSettlement: boolean;
autoApprove: boolean;
autoPayout: boolean;
applyRebateToPayout: boolean;
playRulesHtmlZh: string;
playRulesHtmlEn: string;
playRulesHtmlNe: string;
@@ -92,6 +94,7 @@ export function SystemSettingsScreen() {
autoSettlement: true,
autoApprove: true,
autoPayout: true,
applyRebateToPayout: false,
playRulesHtmlZh: "",
playRulesHtmlEn: "",
playRulesHtmlNe: "",
@@ -102,6 +105,7 @@ export function SystemSettingsScreen() {
autoSettlement: true,
autoApprove: true,
autoPayout: true,
applyRebateToPayout: false,
playRulesHtmlZh: "",
playRulesHtmlEn: "",
playRulesHtmlNe: "",
@@ -131,6 +135,7 @@ export function SystemSettingsScreen() {
autoSettlement: Boolean(kv[DRAW_KEYS.AUTO_SETTLEMENT] ?? true),
autoApprove: Boolean(kv[DRAW_KEYS.AUTO_APPROVE] ?? true),
autoPayout: Boolean(kv[DRAW_KEYS.AUTO_PAYOUT] ?? true),
applyRebateToPayout: Boolean(kv[DRAW_KEYS.APPLY_REBATE_TO_PAYOUT] ?? false),
playRulesHtmlZh: String(kv[FRONTEND_KEYS.PLAY_RULES_HTML_ZH] ?? legacyHtml),
playRulesHtmlEn: String(kv[FRONTEND_KEYS.PLAY_RULES_HTML_EN] ?? ""),
playRulesHtmlNe: String(kv[FRONTEND_KEYS.PLAY_RULES_HTML_NE] ?? ""),
@@ -167,6 +172,7 @@ export function SystemSettingsScreen() {
await updateAdminSetting(DRAW_KEYS.AUTO_SETTLEMENT, draft.autoSettlement);
await updateAdminSetting(DRAW_KEYS.AUTO_APPROVE, draft.autoApprove);
await updateAdminSetting(DRAW_KEYS.AUTO_PAYOUT, draft.autoPayout);
await updateAdminSetting(DRAW_KEYS.APPLY_REBATE_TO_PAYOUT, draft.applyRebateToPayout);
await updateAdminSetting(FRONTEND_KEYS.PLAY_RULES_HTML_ZH, draft.playRulesHtmlZh);
await updateAdminSetting(FRONTEND_KEYS.PLAY_RULES_HTML_EN, draft.playRulesHtmlEn);
await updateAdminSetting(FRONTEND_KEYS.PLAY_RULES_HTML_NE, draft.playRulesHtmlNe);
@@ -242,6 +248,21 @@ export function SystemSettingsScreen() {
<div className="h-px bg-border/60" />
<div className="flex flex-wrap items-center justify-between gap-3">
<div className="min-w-0 space-y-1 pr-4">
<Label className="text-sm font-medium">{t("system.fields.applyRebateToPayout", { ns: "config" })}</Label>
<p className="text-xs text-muted-foreground">{t("system.hints.applyRebateToPayout", { ns: "config" })}</p>
</div>
<Switch
checked={draft.applyRebateToPayout}
disabled={loading || saving}
aria-label={t("system.fields.applyRebateToPayout", { ns: "config" })}
onCheckedChange={(value) => updateDraft("applyRebateToPayout", value)}
/>
</div>
<div className="h-px bg-border/60" />
<div className="grid max-w-xs gap-2">
<Label htmlFor="cooldown-minutes" className="text-sm font-medium">
{t("system.fields.cooldownMinutes", { ns: "config" })}