GlideSystem - getMessageS(String messageID, Object args)

Retrieves translated messages to display in the UI and escapes all ticks (').

If the specified string exists in the database for the current language, then the translated message is returned. If the specified string does not exist for the current language, then the English version of the string is returned. If the string does not exist at all in the database, then the ID itself is returned. Useful if you are inserting into a JavaScript expression from Jelly.

Table 1. Parameters
Name Type Description
MessageID String The ID of the message.
args Object (Optional) a list of strings or other values defined by java.text.MessageFormat, which allows you to produce language-neutral messages for display to users.
Table 2. Returns
Type Description
String The message with ticks escaped.
/*
"I love France" translates to "J'aime la France" in French.
Rendering this without escaping the tick in "J'aime" would break Jelly, because 
the tick would prematurely end the variable assignment, and everything that 
follows (aime la France') would be a jelly syntax error.
*/
var my_message = '${gs.getMessageS("I love France")}'; 
alert(my_message);

Output:

J'aime la France