feat(i18n): add batch group switch text to English, Nepali, and Chinese locales
- Updated the English, Nepali, and Chinese locale files to include a new translation for "Toggle batch switch for {{group}}".
- Enhanced internationalization support for the admin interface by adding relevant strings for improved user experience.
This commit is contained in:
@@ -10,19 +10,14 @@ import {
|
||||
} from "@/api/admin-jackpot";
|
||||
import { useConfirmAction } from "@/hooks/use-confirm-action";
|
||||
import { adminHasAnyPermission } from "@/lib/admin-permissions";
|
||||
import { formatAdminMinorDecimal, parseAdminMajorToMinor } from "@/lib/money";
|
||||
import { PRD_JACKPOT_MANAGE, PRD_JACKPOT_MANUAL_BURST } from "@/lib/admin-prd";
|
||||
import { ModuleScaffold } from "@/components/admin/module-scaffold";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Label } from "@/components/ui/label";
|
||||
import {
|
||||
Select,
|
||||
SelectContent,
|
||||
SelectItem,
|
||||
SelectTrigger,
|
||||
SelectValue,
|
||||
} from "@/components/ui/select";
|
||||
import { Switch } from "@/components/ui/switch";
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
@@ -50,12 +45,12 @@ type Draft = {
|
||||
|
||||
function toDraft(p: AdminJackpotPoolRow): Draft {
|
||||
return {
|
||||
current_amount: String(p.current_amount),
|
||||
current_amount: formatAdminMinorDecimal(p.current_amount, p.currency_code),
|
||||
contribution_rate: String(p.contribution_rate),
|
||||
trigger_threshold: String(p.trigger_threshold),
|
||||
trigger_threshold: formatAdminMinorDecimal(p.trigger_threshold, p.currency_code),
|
||||
payout_rate: String(p.payout_rate),
|
||||
force_trigger_draw_gap: String(p.force_trigger_draw_gap),
|
||||
min_bet_amount: String(p.min_bet_amount),
|
||||
min_bet_amount: formatAdminMinorDecimal(p.min_bet_amount, p.currency_code),
|
||||
combo_trigger_play_codes: p.combo_trigger_play_codes.join(","),
|
||||
status: String(p.status),
|
||||
manual_burst_draw_id: "",
|
||||
@@ -116,12 +111,12 @@ export function JackpotPoolsConsole({ embedded = false }: JackpotPoolsConsolePro
|
||||
setSavingId(p.id);
|
||||
try {
|
||||
await putAdminJackpotPool(p.id, {
|
||||
current_amount: Number.parseInt(d.current_amount, 10),
|
||||
current_amount: parseAdminMajorToMinor(d.current_amount, p.currency_code) ?? 0,
|
||||
contribution_rate: Number(d.contribution_rate),
|
||||
trigger_threshold: Number.parseInt(d.trigger_threshold, 10),
|
||||
trigger_threshold: parseAdminMajorToMinor(d.trigger_threshold, p.currency_code) ?? 0,
|
||||
payout_rate: Number(d.payout_rate),
|
||||
force_trigger_draw_gap: Number.parseInt(d.force_trigger_draw_gap, 10),
|
||||
min_bet_amount: Number.parseInt(d.min_bet_amount, 10),
|
||||
min_bet_amount: parseAdminMajorToMinor(d.min_bet_amount, p.currency_code) ?? 0,
|
||||
combo_trigger_play_codes: d.combo_trigger_play_codes
|
||||
.split(",")
|
||||
.map((v) => v.trim().toLowerCase())
|
||||
@@ -240,20 +235,19 @@ export function JackpotPoolsConsole({ embedded = false }: JackpotPoolsConsolePro
|
||||
onChange={(e) => updateDraft(p.id, { combo_trigger_play_codes: e.target.value })}
|
||||
/>
|
||||
</div>
|
||||
<div className="space-y-1.5">
|
||||
<Label htmlFor={`status-${p.id}`}>{t("status")}</Label>
|
||||
<Select
|
||||
value={d.status}
|
||||
onValueChange={(v) => updateDraft(p.id, { status: v ?? "0" })}
|
||||
>
|
||||
<SelectTrigger id={`status-${p.id}`} className="w-full">
|
||||
<SelectValue>{d.status === "1" ? t("enabled") : t("disabled")}</SelectValue>
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="0">{t("disabled")}</SelectItem>
|
||||
<SelectItem value="1">{t("enabled")}</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
<div className="flex items-center justify-between gap-3 rounded-lg border border-border/60 px-3 py-2.5">
|
||||
<Label htmlFor={`status-${p.id}`} className="text-sm font-medium">
|
||||
{t("status")}
|
||||
</Label>
|
||||
<Switch
|
||||
id={`status-${p.id}`}
|
||||
checked={d.status === "1"}
|
||||
disabled={!canManageJackpot}
|
||||
aria-label={t("status")}
|
||||
onCheckedChange={(checked) =>
|
||||
updateDraft(p.id, { status: checked ? "1" : "0" })
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
</fieldset>
|
||||
{canManageJackpot ? (
|
||||
|
||||
Reference in New Issue
Block a user