6fd31a9996
- Add src/locales/ with en baseline and zh overrides (Partial<Record> fallback) - Add src/shared/i18n.ts with initI18n/t/setLocale/getLocale (LANG env auto-detect) - Add I18nConfigSchema with locale field to plugin config - Internationalize 13 hardcoded strings in task-toast-manager - Add 18 unit tests for i18n module - Pin manager tests to en locale for determinism
13 lines
311 B
TypeScript
13 lines
311 B
TypeScript
import en, { type TranslationKey } from "./en"
|
|
import zh from "./zh"
|
|
|
|
export type { TranslationKey }
|
|
export type SupportedLocale = "en" | "zh"
|
|
export type LocaleMessages = Record<TranslationKey, string>
|
|
|
|
type LocaleMap = Record<SupportedLocale, LocaleMessages>
|
|
export const locales: LocaleMap = {
|
|
en,
|
|
zh,
|
|
}
|