idea-toolbox
Version:
IDEA's utility functions
24 lines (23 loc) • 717 B
TypeScript
import { Languages } from './languages.model';
/**
* Each of the attributes contains the translation in that language of the Label.
*
* Example:
* ```
* name.it: 'ciao';
* name.en: 'hello';
* ```
*/
export declare class Label {
/**
* It supports only _key -> values_ of type string, representing translations in different languages.
*/
[key: string]: string | any;
constructor(x?: any, languages?: Languages);
load(x?: any, languages?: Languages): void;
validate(languages: Languages): string[];
/**
* Translate the label in the desired language; in case there's no translation, get the default one.
*/
translate(language: string, languages: Languages): any;
}