feat: implement i18n

This commit is contained in:
Henry Li
2026-01-20 14:06:47 +08:00
parent 6ec023de8b
commit 32a45eb043
21 changed files with 455 additions and 69 deletions

View File

@@ -0,0 +1,23 @@
export { enUS } from "./locales/en-US";
export { zhCN } from "./locales/zh-CN";
export type { Translations } from "./locales/types";
export type Locale = "en-US" | "zh-CN";
// Helper function to detect browser locale
export function detectLocale(): Locale {
// if (typeof window === "undefined") {
// return "en-US";
// }
// const browserLang =
// navigator.language ||
// (navigator as unknown as { userLanguage: string }).userLanguage;
// // Check if browser language is Chinese (zh, zh-CN, zh-TW, etc.)
// if (browserLang.toLowerCase().startsWith("zh")) {
// return "zh-CN";
// }
return "en-US";
}