feat: 优化开奖结果查询与下注弹窗视觉交互,新增中奖查询页
This commit is contained in:
@@ -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
17
src/i18n/language.ts
Normal 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";
|
||||
}
|
||||
Reference in New Issue
Block a user