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:
@@ -16,9 +16,8 @@ import {
|
||||
} from "@/api/admin-player";
|
||||
import { AdminListPaginationFooter } from "@/components/admin/admin-list-pagination-footer";
|
||||
import { AdminTableExportButton } from "@/components/admin/admin-table-export-button";
|
||||
import { AdminStatusBadge } from "@/components/admin/admin-status-badge";
|
||||
import { resolvePlayerStatusTone } from "@/lib/admin-status-tone";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Switch } from "@/components/ui/switch";
|
||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import {
|
||||
Dialog,
|
||||
@@ -377,9 +376,35 @@ export function PlayersConsole(): React.ReactElement {
|
||||
: "—"}
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<AdminStatusBadge status={row.status} tone={resolvePlayerStatusTone(row.status)}>
|
||||
{playerStatusLabelT(row.status, t)}
|
||||
</AdminStatusBadge>
|
||||
{canFreezePlayers ? (
|
||||
<div className="flex justify-center">
|
||||
<Switch
|
||||
checked={row.status === 0}
|
||||
disabled={freezeBusyId === row.id}
|
||||
aria-label={t("status")}
|
||||
onCheckedChange={(checked) => {
|
||||
const name = row.username ?? row.site_player_id;
|
||||
if (checked) {
|
||||
requestConfirm({
|
||||
title: t("confirmUnfreezeTitle"),
|
||||
description: t("confirmUnfreezeDescription", { name }),
|
||||
onConfirm: () => toggleFreeze(row, false),
|
||||
});
|
||||
return;
|
||||
}
|
||||
requestConfirm({
|
||||
title: t("confirmFreezeTitle"),
|
||||
description: t("confirmFreezeDescription", { name }),
|
||||
onConfirm: () => toggleFreeze(row, true),
|
||||
});
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
<span className="text-xs text-muted-foreground">
|
||||
{playerStatusLabelT(row.status, t)}
|
||||
</span>
|
||||
)}
|
||||
</TableCell>
|
||||
<TableCell className="whitespace-nowrap text-xs text-muted-foreground">
|
||||
{row.last_login_at
|
||||
@@ -395,42 +420,6 @@ export function PlayersConsole(): React.ReactElement {
|
||||
<TableCell>
|
||||
{canManagePlayers || canFreezePlayers ? (
|
||||
<div className="flex flex-wrap gap-1">
|
||||
{canFreezePlayers && row.status === 0 ? (
|
||||
<Button
|
||||
type="button"
|
||||
size="sm"
|
||||
variant="outline"
|
||||
disabled={freezeBusyId === row.id}
|
||||
onClick={() => {
|
||||
const name = row.username ?? row.site_player_id;
|
||||
requestConfirm({
|
||||
title: t("confirmFreezeTitle"),
|
||||
description: t("confirmFreezeDescription", { name }),
|
||||
onConfirm: () => toggleFreeze(row, true),
|
||||
});
|
||||
}}
|
||||
>
|
||||
{freezeBusyId === row.id ? t("saving") : t("freeze")}
|
||||
</Button>
|
||||
) : null}
|
||||
{canFreezePlayers && row.status === 1 ? (
|
||||
<Button
|
||||
type="button"
|
||||
size="sm"
|
||||
variant="outline"
|
||||
disabled={freezeBusyId === row.id}
|
||||
onClick={() => {
|
||||
const name = row.username ?? row.site_player_id;
|
||||
requestConfirm({
|
||||
title: t("confirmUnfreezeTitle"),
|
||||
description: t("confirmUnfreezeDescription", { name }),
|
||||
onConfirm: () => toggleFreeze(row, false),
|
||||
});
|
||||
}}
|
||||
>
|
||||
{freezeBusyId === row.id ? t("saving") : t("unfreeze")}
|
||||
</Button>
|
||||
) : null}
|
||||
{canManagePlayers ? (
|
||||
<>
|
||||
<Button
|
||||
|
||||
Reference in New Issue
Block a user