@eclipse-scout/core
Version:
Eclipse Scout runtime
43 lines • 1.95 kB
TypeScript
/// <reference types="jquery" />
import { Locale, LocaleModel } from '../index';
export declare const locales: {
localesMap: {};
bootstrap(url: string): JQuery.Promise<void>;
/** @internal */
_handleBootstrapResponse(url: string, data: any): void;
init(data: LocaleModel[]): void;
/** @internal */
_get(languageTag: string): Locale;
/**
* Checks whether there is a locale definition for the given language tag.
* @param explicit if true, the country code is considered, meaning if languageTag is 'de-CH'
* and there is a locale for 'de' but not for 'de-CH', true will be returned nonetheless. Default false (consistent to #get).
*/
has(languageTag: string, explicit?: boolean): boolean;
/**
* @returns the locale for the given languageTag.
* If there is no locale found for the given tag, it tries to load the locale without the country code.
* If there is still no locale found, null is returned.
*/
get(languageTag: string): Locale;
getNavigatorLanguage(): string;
/**
* @returns for the language returned by the navigator.
* If no locale is found, the first locale with the language of the navigator is returned.
* (e.g. if browser returns 'de' and there is no locale for 'de', check if there is one for 'de-CH', 'de-DE' etc. and take the first.)
* If still no locale is found, the default locale {@link Locale.DEFAULT} is returned.
*/
getNavigatorLocale(): Locale;
getAll(): Locale[];
getAllLanguageTags(): string[];
/**
* Returns the first locale for the given language.
* @param language a language without country code (e.g. en or de)
*/
findFirstForLanguage(language: string): Locale;
/**
* Splits the language tag and returns an array containing the language and the country.
*/
splitLanguageTag(languageTag: string): string[];
};
//# sourceMappingURL=locales.d.ts.map