feat(i18n): add saveFailed message and dimensionRatesMixedHint to locale files

- Updated English, Nepali, and Chinese locale files to include a new message for "Failed to save configuration".
- Added a hint for mixed rebate rates within the same dimension to enhance user understanding.
- Improved internationalization support across multiple locales for better user experience in the admin interface.
This commit is contained in:
2026-05-26 11:23:36 +08:00
parent 4080f0b601
commit 7fb5ec6dff
10 changed files with 181 additions and 65 deletions

View File

@@ -52,7 +52,7 @@ import {
import { useAdminCurrencyCatalog } from "@/hooks/use-admin-currency-catalog";
import { formatAdminMinorUnits } from "@/lib/money";
import { LotteryApiBizError } from "@/types/api/errors";
import type { AdminPlayerRow } from "@/types/api/admin-player";
import type { AdminPlayerRow, AdminPlayerWalletRow } from "@/types/api/admin-player";
function playerStatusLabelT(status: number, t: (key: string) => string): string {
if (status === 0) return t("statusNormal");
@@ -61,6 +61,15 @@ function playerStatusLabelT(status: number, t: (key: string) => string): string
return String(status);
}
function preferredDisplayWallet(row: AdminPlayerRow): AdminPlayerWalletRow | null {
const { wallets, default_currency } = row;
if (wallets.length === 0) {
return null;
}
const code = default_currency.trim().toUpperCase();
return wallets.find((w) => w.currency_code.toUpperCase() === code) ?? wallets[0];
}
const PLAYER_STATUS_OPTIONS = [
{ value: 0, label: "statusNormal" },
{ value: 1, label: "statusFrozen" },
@@ -357,7 +366,9 @@ export function PlayersConsole(): React.ReactElement {
</TableCell>
</TableRow>
) : (
items.map((row) => (
items.map((row) => {
const displayWallet = preferredDisplayWallet(row);
return (
<TableRow key={row.id}>
<TableCell className="tabular-nums">#{row.id}</TableCell>
<TableCell>
@@ -370,13 +381,16 @@ export function PlayersConsole(): React.ReactElement {
<TableCell>{row.nickname ?? "—"}</TableCell>
<TableCell>{row.default_currency}</TableCell>
<TableCell className="whitespace-nowrap text-center tabular-nums text-xs">
{row.wallets.length > 0
? formatAdminMinorUnits(row.wallets[0].balance, row.wallets[0].currency_code)
{displayWallet
? formatAdminMinorUnits(displayWallet.balance, displayWallet.currency_code)
: "—"}
</TableCell>
<TableCell className="whitespace-nowrap text-center tabular-nums text-xs">
{row.wallets.length > 0
? formatAdminMinorUnits(row.wallets[0].available_balance, row.wallets[0].currency_code)
{displayWallet
? formatAdminMinorUnits(
displayWallet.available_balance,
displayWallet.currency_code,
)
: "—"}
</TableCell>
<TableCell>
@@ -451,7 +465,8 @@ export function PlayersConsole(): React.ReactElement {
)}
</TableCell>
</TableRow>
))
);
})
)}
</TableBody>
</Table>