/** * BrightChain i18n setup and configuration. * * Uses createI18nSetup factory for proper engine initialization and registers: * - Core component (automatic via factory) * - Suite Core component (via createSuiteCoreComponentPackage) * - ECIES component (via createEciesComponentPackage) * - BrightChain component (translations defined here) * * Sub-components (BrightHub, BrightPass, BrightMail, BrightChat) are NOT * registered here. They live in their own libs and should be registered * at the app level via registerI18nComponentPackage() after the engine * is created. * * All components support translateStringKey for direct branded enum translation. */ import { EciesStringKeyValue } from '@digitaldefiance/ecies-lib'; import { ComponentConfig, ContextManager, CoreLanguageCode, I18nEngine, IActiveContext, LanguageContextSpace, RequiredBrandedMasterStringsCollection, type I18nComponentPackage } from '@digitaldefiance/i18n-lib'; import { SuiteCoreStringKeyValue } from '@digitaldefiance/suite-core-lib'; import type { BrightChainStringKeyValue } from '../enumerations/brightChainStrings'; import { BrightChainComponentId, BrightChainStringKey, BrightChainStrings } from '../enumerations/brightChainStrings'; export { BrightChainComponentId }; /** * Master strings collection for the BrightChain component. * These are the translations specific to brightchain-lib. */ export declare const BrightChainComponentStrings: RequiredBrandedMasterStringsCollection; /** * Create BrightChain component configuration */ export declare function createBrightChainComponentConfig(): ComponentConfig; /** * Creates an I18nComponentPackage bundling the BrightChain ComponentConfig * with its branded string key enum. Use this with createI18nSetup's * libraryComponents array. */ export declare function createBrightChainComponentPackage(): I18nComponentPackage; /** * Register an I18nComponentPackage with the BrightChain i18n engine. * * Call this after the engine is created (e.g., at app startup) to register * sub-component packages (BrightHub, BrightPass, BrightMail, BrightChat) * that live in their own libs. * * @param pkg - The component package to register */ export declare function registerI18nComponentPackage(pkg: I18nComponentPackage): void; /** * Get or create the BrightChain i18n engine. * * Uses createI18nSetup factory which handles: * - Engine creation/reuse (idempotent via instanceKey 'default') * - Core component registration (automatic) * - Library component registration (SuiteCore, ECIES) * - BrightChain component and branded enum registration * - GlobalActiveContext initialization * * Sub-components (BrightHub, BrightPass, BrightMail, BrightChat) are * registered separately via registerI18nComponentPackage(). */ export declare function getBrightChainI18nEngine(): I18nEngine; /** * Reset the engine instance (useful for testing) */ export declare function resetBrightChainI18nEngine(): void; export declare const i18nEngine: I18nEngine; export { i18nEngine as pluginI18nEngine }; export declare const i18nContext: IActiveContext; /** * Translate any registered branded string key. * Works with EciesStringKey, SuiteCoreStringKey, BrightChainStrings, * and any sub-component keys registered via registerI18nComponentPackage(). * * The engine's built-in browser-safe fallback handles Symbol mismatch * in bundled environments (Vite/webpack) automatically — no manual * component lookup needed. */ export declare function translateStringKey(stringKey: RegisteredStringKey, variables?: Record, language?: CoreLanguageCode): string; /** * Safe translation helper that returns a placeholder on failure. * Works with any registered branded string key. */ export declare function safeTranslateStringKey(stringKey: RegisteredStringKey, variables?: Record, language?: CoreLanguageCode): string; export declare const getBrightChainTranslation: typeof translateStringKey; export declare const safeGetBrightChainTranslation: typeof safeTranslateStringKey; /** * Legacy translate function for backward compatibility. * Prefer getBrightChainTranslation() for new code. */ export declare const translate: (name: BrightChainStringKey, variables?: Record, language?: CoreLanguageCode, context?: LanguageContextSpace) => string; /** * Helper function to translate core strings */ export declare const translateCore: (key: string, variables?: Record, language?: CoreLanguageCode) => string; export declare const contextManager: ContextManager; export declare const setLanguage: (language: CoreLanguageCode) => void; export declare const setAdminLanguage: (language: CoreLanguageCode) => void; export declare const setContext: (context: LanguageContextSpace) => void; export declare const getLanguage: () => CoreLanguageCode; export declare const getAdminLanguage: () => CoreLanguageCode; export { BrightChainStrings }; export type { BrightChainStringKey, BrightChainStringKeyValue }; /** * Union type of all registered branded string keys. * * NOTE: Sub-component key types (BrightPass, BrightHub, BrightMail, BrightChat) * are imported from the enum files in brightchain-lib/enumerations/ for type * compatibility. The actual translations and component packages live in the * respective libs (brightpass-lib, brighthub-lib, brightmail-lib, brightchat-lib). */ export type RegisteredStringKey = BrightChainStringKeyValue | EciesStringKeyValue | SuiteCoreStringKeyValue; export type { IBrightChainI18nConstants } from '../interfaces/i18nConstants'; //# sourceMappingURL=i18n-setup.d.ts.map