1 | import { I18nOptions } from './types';
|
2 | /**
|
3 | * Language transition class
|
4 | */
|
5 | export declare class I18n {
|
6 | /**
|
7 | * @private
|
8 | */
|
9 | _options: I18nOptions;
|
10 | /**
|
11 | * @private
|
12 | */
|
13 | _lang: any;
|
14 | /**
|
15 | * @private
|
16 | */
|
17 | _dict: {};
|
18 | /**
|
19 | * @constructor
|
20 | * Initialize with configurations
|
21 | * @param {Object} options
|
22 | */
|
23 | constructor(options: I18nOptions);
|
24 | /**
|
25 | * @method
|
26 | * Explicitly setting language
|
27 | * @param {String} lang
|
28 | */
|
29 | setLanguage(lang: string): void;
|
30 | /**
|
31 | * @method
|
32 | * Get value
|
33 | * @param {String} key
|
34 | * @param {String} defVal - Default value
|
35 | */
|
36 | get(key: any, defVal?: any): any;
|
37 | /**
|
38 | * @method
|
39 | * Get value according to specified language
|
40 | * @param {String} key
|
41 | * @param {String} language - Specified langurage to be used
|
42 | * @param {String} defVal - Default value
|
43 | */
|
44 | getByLanguage(key: any, language: any, defVal?: any): any;
|
45 | /**
|
46 | * @method
|
47 | * Add vocabularies for one language
|
48 | * @param {String} language - Language of the dictionary
|
49 | * @param {Object} vocabularies - Object that has key-value as dictionary entry
|
50 | */
|
51 | putVocabulariesForLanguage(language: any, vocabularies: any): void;
|
52 | /**
|
53 | * @method
|
54 | * Add vocabularies for one language
|
55 | * @param {Object} vocabularies - Object that has language as key,
|
56 | * vocabularies of each language as value
|
57 | */
|
58 | putVocabularies(vocabularies: any): void;
|
59 | }
|