Methods
add(lang, pageKey, textKey, text)
Add a new localized text for specified specs.
Parameters:
Name | Type | Description |
---|---|---|
lang |
string | Languaeg key. See const-lang.js for definition. |
pageKey |
string | Top level key. Usually it's page key to differentiate each page from one another. |
textKey |
string | Text key. Individual text key to get localized text. |
text |
string | Text to be added. |
clear()
Clear definitions.
get(lang, pageKey, textKey) → {string}
Get localized text from input specs.
Parameters:
Name | Type | Description |
---|---|---|
lang |
string | Language key. See const-lang.js for definition. |
pageKey |
string | Top level key. Usually it's page key to differentiate each page from one another. |
textKey |
string | Text key. Individual text key to get localized text. |
Returns:
Localized text in specified language. Return null if cannot find.
- Type
- string
remove(lang, pageKey, textKey)
Remove text from definition for specified specs.
Note it will do a deep removing of such target text.
Parameters:
Name | Type | Description |
---|---|---|
lang |
string | Language key. See const-lang.js for definition. |
pageKey |
string | Top level key. Usually it's page key to differentiate each page from one another. |
textKey |
string | Text key. Individual text key to get localized text. |