Versions Compared
compared with
Key
- This line was added.
- This line was removed.
- Formatting was changed.
This class provides a method that allows working with the localization data.
SimpleMessage()
Instantiates a new empty SimpleMessage class object
Example:
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
const message = new SimpleMessage(); |
getMessage(message, category, params, language)
This method gets a translation of the message specified and returns it in the user's language.
Parameter(s):
Name | Type | Mandatory | Default Value |
---|---|---|---|
message | String | Y | N |
category | String | N | app |
params | Object | N | N |
language | String | N | NULL |
Return:
Type | Description |
---|---|
String | Returns a message in the user's language. |
Example:
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
const message = new SimpleMessage(); const messageValue = message.getMessage( 'cannot be blank', 'app', {"column_translated_title": "Field Name", "column_name": "field_name"} ); ss.info(messageValue); // Info: The "{column_translated_title}" [{column_name}] field is mandatory. |
And as example, the message settings are as follows:
Example:
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
const message = new SimpleMessage(); const localizedMessage = message.getMessage('Spaces are not allowed in a table name'); ss.addErrorMessage(localizedMessage); |
Same The same example without getMessage method using of the getMessage:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
ss.addErrorMessage('Spaces are not allowed in a table name'); |
To know more about messages configuration, please refer to relevant documentation section dedicated to messages and interface localization.
Table of Contents | ||||
---|---|---|---|---|
|