feat(i18n): 更新英文、尼泊尔语与中文的注单状态翻译
修改多语言配置文件,将 success 统一替换为 placed,并新增 partial_failed 与 refunded 状态,以提升注单管理中的状态表达清晰度。 增强国际化支持,确保多语言间术语一致性,进一步优化后台管理界面的用户体验。
This commit is contained in:
@@ -40,7 +40,6 @@ import {
|
||||
TableHeader,
|
||||
TableRow,
|
||||
} from "@/components/ui/table";
|
||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
||||
import { AdminStatusBadge } from "@/components/admin/admin-status-badge";
|
||||
import { ConfigReadonlyValue } from "@/modules/config/config-readonly-value";
|
||||
import { ConfigVersionActions } from "@/modules/config/config-version-actions";
|
||||
@@ -156,12 +155,6 @@ export function PlayConfigDocScreen() {
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
const detailRequestSeq = useRef(0);
|
||||
|
||||
const [ruleDialogOpen, setRuleDialogOpen] = useState(false);
|
||||
const [rulePlayCode, setRulePlayCode] = useState<string | null>(null);
|
||||
const [ruleDraftZh, setRuleDraftZh] = useState("");
|
||||
const [ruleDraftEn, setRuleDraftEn] = useState("");
|
||||
const [ruleDraftNe, setRuleDraftNe] = useState("");
|
||||
|
||||
const refreshList = useCallback(async () => {
|
||||
setLoadingList(true);
|
||||
setError(null);
|
||||
@@ -361,29 +354,6 @@ export function PlayConfigDocScreen() {
|
||||
}
|
||||
}
|
||||
|
||||
function openRuleEditor(play_code: string) {
|
||||
const item = draftRows.find((row) => row.play_code === play_code);
|
||||
setRulePlayCode(play_code);
|
||||
setRuleDraftZh(item?.rule_text_zh ?? "");
|
||||
setRuleDraftEn(item?.rule_text_en ?? "");
|
||||
setRuleDraftNe(item?.rule_text_ne ?? "");
|
||||
setRuleDialogOpen(true);
|
||||
}
|
||||
|
||||
function saveRuleDraft() {
|
||||
if (!rulePlayCode) {
|
||||
return;
|
||||
}
|
||||
updateConfigRow(rulePlayCode, {
|
||||
rule_text_zh: ruleDraftZh.trim() || null,
|
||||
rule_text_en: ruleDraftEn.trim() || null,
|
||||
rule_text_ne: ruleDraftNe.trim() || null,
|
||||
});
|
||||
setRuleDialogOpen(false);
|
||||
setRulePlayCode(null);
|
||||
toast.message(t("play.ruleSavedLocal", { ns: "config" }));
|
||||
}
|
||||
|
||||
function renderDisplayNameReadonly(row: PlayConfigItemRow) {
|
||||
const name = row.display_name?.trim();
|
||||
return <span>{name || row.play_code}</span>;
|
||||
@@ -580,7 +550,6 @@ export function PlayConfigDocScreen() {
|
||||
<TableHead className="w-24 text-center">{t("play.table.order", { ns: "config" })}</TableHead>
|
||||
<TableHead className="w-[110px] text-center">{t("play.table.minBet", { ns: "config" })}</TableHead>
|
||||
<TableHead className="w-[110px] text-center">{t("play.table.maxBet", { ns: "config" })}</TableHead>
|
||||
<TableHead className="w-[140px] text-center">{t("play.table.actions", { ns: "config" })}</TableHead>
|
||||
</TableRow>
|
||||
</TableHeader>
|
||||
<TableBody>
|
||||
@@ -712,78 +681,12 @@ export function PlayConfigDocScreen() {
|
||||
</ConfigReadonlyValue>
|
||||
)}
|
||||
</TableCell>
|
||||
<TableCell className="text-center">
|
||||
{isDraft ? (
|
||||
<Button
|
||||
type="button"
|
||||
variant="outline"
|
||||
disabled={saving}
|
||||
onClick={() => openRuleEditor(row.play_code)}
|
||||
>
|
||||
{t("play.actions.ruleText", { ns: "config" })}
|
||||
</Button>
|
||||
) : (
|
||||
<AdminStatusBadge status="disabled" className="mx-auto w-fit">
|
||||
{t("play.states.readOnly", { ns: "config" })}
|
||||
</AdminStatusBadge>
|
||||
)}
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
))}
|
||||
</TableBody>
|
||||
</Table>
|
||||
)}
|
||||
|
||||
<Dialog open={ruleDialogOpen} onOpenChange={setRuleDialogOpen}>
|
||||
<DialogContent showCloseButton className="sm:max-w-lg">
|
||||
<DialogHeader>
|
||||
<DialogTitle>{t("play.ruleDialog.title", { ns: "config" })}</DialogTitle>
|
||||
<DialogDescription>
|
||||
{t("play.ruleDialog.description", { ns: "config", playCode: rulePlayCode ?? "—" })}
|
||||
</DialogDescription>
|
||||
</DialogHeader>
|
||||
<Tabs defaultValue="zh" className="w-full">
|
||||
<TabsList className="w-full">
|
||||
<TabsTrigger value="zh">{t("play.locales.zh", { ns: "config" })}</TabsTrigger>
|
||||
<TabsTrigger value="en">{t("play.locales.en", { ns: "config" })}</TabsTrigger>
|
||||
<TabsTrigger value="ne">{t("play.locales.ne", { ns: "config" })}</TabsTrigger>
|
||||
</TabsList>
|
||||
<TabsContent value="zh" className="mt-3">
|
||||
<textarea
|
||||
id="rule-zh"
|
||||
className="border-input bg-background ring-ring/24 focus-visible:ring-[3px] min-h-[140px] w-full rounded-lg border px-3 py-2 text-sm outline-none"
|
||||
value={ruleDraftZh}
|
||||
onChange={(e) => setRuleDraftZh(e.target.value)}
|
||||
/>
|
||||
</TabsContent>
|
||||
<TabsContent value="en" className="mt-3">
|
||||
<textarea
|
||||
id="rule-en"
|
||||
className="border-input bg-background ring-ring/24 focus-visible:ring-[3px] min-h-[140px] w-full rounded-lg border px-3 py-2 text-sm outline-none"
|
||||
value={ruleDraftEn}
|
||||
onChange={(e) => setRuleDraftEn(e.target.value)}
|
||||
/>
|
||||
</TabsContent>
|
||||
<TabsContent value="ne" className="mt-3">
|
||||
<textarea
|
||||
id="rule-ne"
|
||||
className="border-input bg-background ring-ring/24 focus-visible:ring-[3px] min-h-[140px] w-full rounded-lg border px-3 py-2 text-sm outline-none"
|
||||
value={ruleDraftNe}
|
||||
onChange={(e) => setRuleDraftNe(e.target.value)}
|
||||
/>
|
||||
</TabsContent>
|
||||
</Tabs>
|
||||
<DialogFooter>
|
||||
<Button type="button" variant="outline" onClick={() => setRuleDialogOpen(false)}>
|
||||
{t("actions.cancel", { ns: "adminUsers" })}
|
||||
</Button>
|
||||
<Button type="button" onClick={saveRuleDraft}>
|
||||
{t("play.ruleDialog.apply", { ns: "config" })}
|
||||
</Button>
|
||||
</DialogFooter>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
|
||||
<Dialog open={rollbackOpen} onOpenChange={setRollbackOpen}>
|
||||
<DialogContent showCloseButton className="sm:max-w-md">
|
||||
<DialogHeader>
|
||||
|
||||
Reference in New Issue
Block a user