@geogirafe/lib-geoportal
Version:
GeoGirafe is a flexible application to build online geoportals.
40 lines (39 loc) • 1.09 kB
TypeScript
import ConfigManager from '../configuration/configmanager';
import StateManager from '../state/statemanager';
import GirafeSingleton from '../../base/GirafeSingleton';
/**
* A dictionary that holds translation strings.
* For example:
* {
* 'layer': 'couche'
* }
*/
export type TranslationsDict = {
[lang: string]: string;
};
/**
* A dictionary that holds all the languages with their translation strings.
* For example:
* {
* 'fr': {
* 'layer': 'couche'
* },
* }
*/
type AvailableLanguages = {
[lang: string]: TranslationsDict;
};
declare class I18nManager extends GirafeSingleton {
translations: AvailableLanguages;
loadingLanguagePromise: Promise<TranslationsDict> | null;
configManager: ConfigManager;
stateManager: StateManager;
constructor(type: string);
formatNumber(number: string | number): string;
private loadTranslations;
getTranslation(key: string): string;
translate(dom: DocumentFragment | HTMLElement): Promise<void>;
handleLanguageChange(): void;
private getFnTranslated;
}
export default I18nManager;