/** * I18nRegistry — shared locale-aware message registry for all farm plugins. * * Plugins register their message bundles (per locale) at startup. * The registry resolves messages by plugin name + key + current locale. * * Usage: * import { i18n } from 'plugin-common-lib/i18n' * import messages from './messages.js' * * i18n.register('struct', messages) * i18n.setLocale('zh') * i18n.msg('struct', 'doubleFree', '0x1A3F') * // → "在指针 0x1A3F 处检测到重复释放。该块已被释放。" */ import type { Locale, MessageBundle } from './types.js'; export declare class I18nRegistry { private locale; private bundles; setLocale(locale: Locale): void; getLocale(): Locale; /** Register a plugin's messages for all locales */ register(pluginName: string, messages: Record): void; /** Unregister a plugin's messages (for HMR) */ unregister(pluginName: string): void; /** Get a localized message from a plugin */ msg(pluginName: string, key: string, ...args: any[]): string; /** Check if a plugin has a specific message key */ has(pluginName: string, key: string): boolean; /** List all registered plugin names */ listPlugins(): string[]; } /** Global singleton registry */ export declare const i18n: I18nRegistry;