import { Locale } from "vant";
import enUS from "vant/es/locale/lang/en-US";
import thTH from "vant/es/locale/lang/th-TH";
import zhCN from "vant/es/locale/lang/zh-CN";
import type { SupportedLocale } from "./types.ts";

const vantMessages = {
  "zh-CN": zhCN,
  "en-US": enUS,
  "th-TH": thTH,
} satisfies Record<SupportedLocale, Record<string, unknown>>;

export function syncVantLocale(locale: SupportedLocale): void {
  Locale.use(locale, vantMessages[locale]);
}
