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:
@@ -15,6 +15,7 @@ import { Button } from "@/components/ui/button";
|
||||
import { Card, CardContent } from "@/components/ui/card";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Label } from "@/components/ui/label";
|
||||
import { Switch } from "@/components/ui/switch";
|
||||
import { Textarea } from "@/components/ui/textarea";
|
||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
||||
import { LotteryApiBizError } from "@/types/api/errors";
|
||||
@@ -49,45 +50,6 @@ interface RuntimeDraft {
|
||||
playRulesHtmlNe: string;
|
||||
}
|
||||
|
||||
function BinaryChoice({
|
||||
active,
|
||||
disabled,
|
||||
onChange,
|
||||
leftLabel,
|
||||
rightLabel,
|
||||
}: {
|
||||
active: boolean;
|
||||
disabled: boolean;
|
||||
onChange: (value: boolean) => void;
|
||||
leftLabel: string;
|
||||
rightLabel: string;
|
||||
}) {
|
||||
return (
|
||||
<div className="inline-flex rounded-full border border-border/60 bg-background p-1">
|
||||
<Button
|
||||
type="button"
|
||||
size="sm"
|
||||
variant={!active ? "default" : "ghost"}
|
||||
className={!active ? "h-8 rounded-full px-3" : "h-8 rounded-full px-3 text-muted-foreground"}
|
||||
disabled={disabled}
|
||||
onClick={() => onChange(false)}
|
||||
>
|
||||
{leftLabel}
|
||||
</Button>
|
||||
<Button
|
||||
type="button"
|
||||
size="sm"
|
||||
variant={active ? "default" : "ghost"}
|
||||
className={active ? "h-8 rounded-full px-3" : "h-8 rounded-full px-3 text-muted-foreground"}
|
||||
disabled={disabled}
|
||||
onClick={() => onChange(true)}
|
||||
>
|
||||
{rightLabel}
|
||||
</Button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function SaveActions({
|
||||
dirty,
|
||||
loading,
|
||||
@@ -234,12 +196,11 @@ export function SystemSettingsScreen() {
|
||||
<div className="space-y-5">
|
||||
<div className="flex flex-wrap items-center justify-between gap-3">
|
||||
<Label className="text-sm font-medium">{t("system.fields.manualReview", { ns: "config" })}</Label>
|
||||
<BinaryChoice
|
||||
active={draft.requireManualReview}
|
||||
<Switch
|
||||
checked={draft.requireManualReview}
|
||||
disabled={loading || saving}
|
||||
onChange={(value) => updateDraft("requireManualReview", value)}
|
||||
leftLabel={t("system.states.disabled", { ns: "config" })}
|
||||
rightLabel={t("system.states.enabled", { ns: "config" })}
|
||||
aria-label={t("system.fields.manualReview", { ns: "config" })}
|
||||
onCheckedChange={(value) => updateDraft("requireManualReview", value)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -247,12 +208,11 @@ export function SystemSettingsScreen() {
|
||||
|
||||
<div className="flex flex-wrap items-center justify-between gap-3">
|
||||
<Label className="text-sm font-medium">{t("system.fields.autoSettlement", { ns: "config" })}</Label>
|
||||
<BinaryChoice
|
||||
active={draft.autoSettlement}
|
||||
<Switch
|
||||
checked={draft.autoSettlement}
|
||||
disabled={loading || saving}
|
||||
onChange={(value) => updateDraft("autoSettlement", value)}
|
||||
leftLabel={t("system.states.disabled", { ns: "config" })}
|
||||
rightLabel={t("system.states.enabled", { ns: "config" })}
|
||||
aria-label={t("system.fields.autoSettlement", { ns: "config" })}
|
||||
onCheckedChange={(value) => updateDraft("autoSettlement", value)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -260,12 +220,11 @@ export function SystemSettingsScreen() {
|
||||
|
||||
<div className="flex flex-wrap items-center justify-between gap-3">
|
||||
<Label className="text-sm font-medium">{t("system.fields.autoApprove", { ns: "config" })}</Label>
|
||||
<BinaryChoice
|
||||
active={draft.autoApprove}
|
||||
<Switch
|
||||
checked={draft.autoApprove}
|
||||
disabled={loading || saving}
|
||||
onChange={(value) => updateDraft("autoApprove", value)}
|
||||
leftLabel={t("system.states.disabled", { ns: "config" })}
|
||||
rightLabel={t("system.states.enabled", { ns: "config" })}
|
||||
aria-label={t("system.fields.autoApprove", { ns: "config" })}
|
||||
onCheckedChange={(value) => updateDraft("autoApprove", value)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -273,12 +232,11 @@ export function SystemSettingsScreen() {
|
||||
|
||||
<div className="flex flex-wrap items-center justify-between gap-3">
|
||||
<Label className="text-sm font-medium">{t("system.fields.autoPayout", { ns: "config" })}</Label>
|
||||
<BinaryChoice
|
||||
active={draft.autoPayout}
|
||||
<Switch
|
||||
checked={draft.autoPayout}
|
||||
disabled={loading || saving}
|
||||
onChange={(value) => updateDraft("autoPayout", value)}
|
||||
leftLabel={t("system.states.disabled", { ns: "config" })}
|
||||
rightLabel={t("system.states.enabled", { ns: "config" })}
|
||||
aria-label={t("system.fields.autoPayout", { ns: "config" })}
|
||||
onCheckedChange={(value) => updateDraft("autoPayout", value)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user