/** * Interface language for the TUI: a module-level current language with a * message accessor, mirroring the theme module's setTheme/getPalette shape * so a language switch re-renders every translated surface on the next * render without touching call sites. English is the default; the persisted * choice lives in language.json next to theme.json (see the runner's * persistence block). * * @module @deepseek-ai/dsh-tui/i18n */ import { type MessageKey } from './locales/en.ts'; export type { MessageKey } from './locales/en.ts'; /** Selectable interface languages: English (default) and Chinese. */ export type LanguageName = 'en' | 'zh'; /** Valid language names for argument parsing. */ export declare const LANGUAGE_NAMES: readonly LanguageName[]; /** One language's picker row. */ export interface LanguageDescriptor { readonly id: LanguageName; readonly label: string; } /** The /language picker rows in canonical order. */ export declare const LANGUAGES: readonly LanguageDescriptor[]; /** * Parse a persisted or typed language name: only 'en' and 'zh' survive; * anything else falls back to English. */ export declare function parseLanguageName(value: unknown): LanguageName; /** The language name in force. */ export declare function getLanguage(): LanguageName; /** Switch the active language; the next render paints with the new catalog. */ export declare function setLanguage(name: LanguageName): void; /** * One message from the active catalog, with `{n}`-style placeholders filled * from the params record. Unknown placeholders stay literal; a missing key * falls back to the English entry so a catalog gap degrades visibly but * never crashes. */ export declare function t(key: MessageKey, params?: Readonly>): string;