import { EventEmitter, InjectionToken } from '@angular/core'; import { HttpClient } from '@angular/common/http'; import { TranslateSettings } from './translate.settings'; import * as i0 from "@angular/core"; export declare const TRANSLATE_SETTINGS: InjectionToken; export interface TranslateParams { [key: string]: string | number; } export declare class TranslateService { private http; protected data: { [key: string]: any; }; private _fallbackLang; private _activeLang; private _translationRoot; /** * Raised each time active language gets changed. */ activeLangChanged: EventEmitter<{ previousValue: string; currentValue: string; }>; /** * Toggles debug mode. * * When in the debug mode, the service automatically prepends active language id to very translated result. * That allows to verify that your components support i18n correctly and do not contain hard-coded text. */ debugMode: boolean; /** * Disable caching and always download language files. * * Applies cache busting query parameters to urls, for example: '?v=1522426955882'. */ disableCache: boolean; /** * List of supported languages. * * The service will attempt to load resource files only for given set of languages, * and will automatically use fallback language for all unspecified values. * * By default this property is empty and service is going to probe all language files. * Active and Fallback languages are always taken into account even if you do not specify them in the list. */ supportedLangs: string[]; /** * List of extra paths to look for translation files. * * By default this property is empty. * The value of `translationRoot` property is always taken into account. */ translatePaths: string[]; /** * The fallback language to use when a resource string for the active language is not available. */ get fallbackLang(): string; set fallbackLang(value: string); /** * The language to use for the translations. */ get activeLang(): string; set activeLang(value: string); getBrowserLanguage(): string; /** * The root path to use when loading default translation files. * Defaults to 'assets/i18n'. */ get translationRoot(): string; set translationRoot(value: string); constructor(http: HttpClient, settings: TranslateSettings); protected applySettings(settings: TranslateSettings): void; /** * Get translated string * * @param key Translation key * @param [params] Translation parameters * @param [lang] Language to use for translation * @returns Translated string * @memberof TranslateService */ get(key: T, params?: TranslateParams, lang?: string): T; load(): Promise; /** * Load the translation file or use provided data for the given language. * * @param lang Language name * @param [data] Translation data to use * @returns Final translation data merged with existing translations * @memberof TranslateService */ use(lang: string, data?: any): Promise; protected loadTranslation(lang: string, path: string): Promise; protected isNotSupported(lang: string): boolean; protected getValue(lang: string, key: string): string; protected setTranslation(lang: string, data: any): any; protected merge(...translations: any[]): any; protected format(str: string, params: TranslateParams): string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; }