This class provides a method that allows working with the localization data.

SimpleMessage()


Instantiates a new empty SimpleMessage class object

Example:

const message = new SimpleMessage();


getMessage(message, category)


This method gets a translation of the message specified and returns it in the user's language.


Parameter(s):

NameTypeMandatoryDefault Value
messageStringYN
categoryStringNapp
paramsObjectNN


Return:

TypeDescription
StringReturns a message in the user's language.


Example:

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.


const message = new SimpleMessage();
const localizedMessage = message.getMessage('Spaces not allowed in table name');
ss.addErrorMessage(localizedMessage);