/** 对齐后端与产品：尼泊尔语 / 英语 / 中文（简体） */
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";
}
