UNPKG

@o3r/localization

Version:

This module provides a runtime dynamic language/translation support and debug tools.

51 lines 1.84 kB
import { InjectionToken } from '@angular/core'; import { TranslateCompiler } from '@ngx-translate/core'; import { Options } from 'intl-messageformat'; import * as i0 from "@angular/core"; /** * Options for Lazy Message Format compiler */ export interface LazyMessageFormatConfig extends Options { /** * Enables compiled translation caching * @default true */ enableCache?: boolean; /** * Enables HTML in translation * @default true */ ignoreTag?: boolean; } /** * Message format configuration default value */ export declare const lazyMessageDefaultConfig: Readonly<LazyMessageFormatConfig>; /** Message Format configuration Token */ export declare const MESSAGE_FORMAT_CONFIG: InjectionToken<LazyMessageFormatConfig>; /** * This compiler expects ICU syntax and compiles the expressions with messageformat.js * Compare to ngx-translate-messageformat-compiler package, the compilation of the translation is done only on demand */ export declare class TranslateMessageFormatLazyCompiler extends TranslateCompiler { /** Configuration */ private readonly config; /** Cache of compiled translations */ private cache; constructor(config?: LazyMessageFormatConfig); /** * Clear the cache of the compiled translations */ clearCache(): void; /** @inheritDoc */ compile(value: string, lang: string): (params: any) => string; /** @inheritDoc */ compileTranslations(translations: { [x: string]: any; }, lang: string): { [x: string]: (params: any) => string; }; static ɵfac: i0.ɵɵFactoryDeclaration<TranslateMessageFormatLazyCompiler, [{ optional: true; }]>; static ɵprov: i0.ɵɵInjectableDeclaration<TranslateMessageFormatLazyCompiler>; } //# sourceMappingURL=translate-messageformat-lazy.compiler.d.ts.map