feat: 优化开奖结果查询与下注弹窗视觉交互,新增中奖查询页

This commit is contained in:
2026-05-19 14:40:00 +08:00
parent 321b56e997
commit a2a29107f8
17 changed files with 488 additions and 82 deletions

View File

@@ -16,17 +16,17 @@ import zhCommon from "./locales/zh/common.json";
import zhEntry from "./locales/zh/entry.json";
import zhLayout from "./locales/zh/layout.json";
import zhPlayer from "./locales/zh/player.json";
/** 对齐后端与产品:尼泊尔语 / 英语 / 中文(简体) */
export const SUPPORTED_LANGUAGES = [
{ code: "en" as const, flag: "🇺🇸" },
{ code: "ne" as const, flag: "🇳🇵" },
{ code: "zh" as const, flag: "🇨🇳" },
];
export type AppLanguage = (typeof SUPPORTED_LANGUAGES)[number]["code"];
export const DEFAULT_LANGUAGE: AppLanguage = "en";
import {
DEFAULT_LANGUAGE,
normalizeLanguage,
type AppLanguage,
} from "@/i18n/language";
export {
DEFAULT_LANGUAGE,
normalizeLanguage,
SUPPORTED_LANGUAGES,
type AppLanguage,
} from "@/i18n/language";
const namespaces = ["common", "entry", "layout", "player"] as const;
@@ -54,13 +54,6 @@ const resources = {
Record<(typeof namespaces)[number], Record<string, unknown>>
>;
export function normalizeLanguage(lang: string | undefined): AppLanguage {
const base = lang?.split("-")[0]?.toLowerCase();
if (base === "ne") return "ne";
if (base === "zh") return "zh";
return "en";
}
export function syncDocumentLanguage(lang: AppLanguage): void {
if (typeof document === "undefined") return;

17
src/i18n/language.ts Normal file
View File

@@ -0,0 +1,17 @@
/** 对齐后端与产品:尼泊尔语 / 英语 / 中文(简体) */
export const SUPPORTED_LANGUAGES = [
{ code: "en" as const, flag: "🇺🇸" },
{ code: "ne" as const, flag: "🇳🇵" },
{ code: "zh" as const, flag: "🇨🇳" },
];
export type AppLanguage = (typeof SUPPORTED_LANGUAGES)[number]["code"];
export const DEFAULT_LANGUAGE: AppLanguage = "zh";
export function normalizeLanguage(lang: string | undefined): AppLanguage {
const base = lang?.split("-")[0]?.toLowerCase();
if (base === "ne") return "ne";
if (base === "zh") return "zh";
return "en";
}