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

9
src/i18n/types.ts Normal file
View File

@@ -0,0 +1,9 @@
export const supportedLocales = ["zh-CN", "en-US", "th-TH"] as const;
export type SupportedLocale = (typeof supportedLocales)[number];
export const defaultLocale: SupportedLocale = "zh-CN";
export type LocaleMessageSchema<T> = {
readonly [Key in keyof T]: T[Key] extends string ? string : LocaleMessageSchema<T[Key]>;
};