feat: add modular i18n foundation

This commit is contained in:
duanshuwen
2026-05-26 14:37:32 +08:00
parent a9b00627e2
commit b05d5a72cd
24 changed files with 606 additions and 4 deletions

View File

@@ -0,0 +1,14 @@
export default {
actions: {
cancel: "Cancel",
confirm: "Confirm",
retry: "Retry",
},
errors: {
network: "Network error. Please try again later.",
},
state: {
empty: "No data",
loading: "Loading...",
},
} as const;

View File

@@ -0,0 +1,12 @@
import type { LocaleMessageSchema, SupportedLocale } from "../../types.ts";
import enUS from "./en-US.ts";
import thTH from "./th-TH.ts";
import zhCN from "./zh-CN.ts";
export type CommonMessages = LocaleMessageSchema<typeof zhCN>;
export const commonMessages = {
"zh-CN": zhCN,
"en-US": enUS,
"th-TH": thTH,
} satisfies Record<SupportedLocale, CommonMessages>;

View File

@@ -0,0 +1,14 @@
export default {
actions: {
cancel: "ยกเลิก",
confirm: "ยืนยัน",
retry: "ลองอีกครั้ง",
},
errors: {
network: "เครือข่ายผิดพลาด โปรดลองอีกครั้งในภายหลัง",
},
state: {
empty: "ไม่มีข้อมูล",
loading: "กำลังโหลด...",
},
} as const;

View File

@@ -0,0 +1,14 @@
export default {
actions: {
cancel: "取消",
confirm: "确认",
retry: "重试",
},
errors: {
network: "网络异常,请稍后重试",
},
state: {
empty: "暂无数据",
loading: "加载中...",
},
} as const;