@theia/core
Version:
Theia is a cloud & desktop IDE framework implemented in TypeScript.
35 lines • 1.5 kB
TypeScript
export declare const localizationPath = "/services/i18n";
export declare const AsyncLocalizationProvider: unique symbol;
export interface AsyncLocalizationProvider {
getCurrentLanguage(): Promise<string>;
setCurrentLanguage(languageId: string): Promise<void>;
getAvailableLanguages(): Promise<LanguageInfo[]>;
loadLocalization(languageId: string): Promise<Localization>;
}
export interface Localization extends LanguageInfo {
translations: {
[key: string]: string;
};
}
export interface LanguageInfo {
languageId: string;
languageName?: string;
languagePack?: boolean;
localizedLanguageName?: string;
}
export declare type FormatType = string | number | boolean | undefined;
export declare namespace Localization {
function format(message: string, args: FormatType[]): string;
function format(message: string, args: Record<string | number, FormatType>): string;
function localize(localization: Localization | undefined, key: string, defaultValue: string, ...args: FormatType[]): string;
/**
* This function normalizes values from VSCode's localizations, which often contain additional mnemonics (`&&`).
* The normalization removes the mnemonics from the input string.
*
* @param value Localization value coming from VSCode
* @returns A normalized localized value
*/
function normalize(value: string): string;
function transformKey(key: string): string;
}
//# sourceMappingURL=localization.d.ts.map