- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2016 05:35 AM
var ret = ' ';
....
....
if(counter_app == 0){
switch(counter_level){
case 0:
ret += "First level of approval "; // <------ how to get such string translated?
break;
....
}
if (when.indexOf('always') == -1)
ret += '\(Depends on selected options)\: '; <--------- how to get such string translated too?
else ...
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2016 05:41 AM
Sorry Anna,
I thought you were doing a client script.
For server side scripts (business rules, UI actions, etc) there's no Messages field and you use the gs.getMessage() call.
For best results, go to System UI> Messages and create your translated messages. For example,
key=first_level_of_approval, Message=First level of approval
Now in your script...
ret += gs.getMessage('first_level_of_approval');
This may also be helpful: gs.getMessage() - The Second Parameter

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2017 06:30 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2019 03:53 AM
https://docs.servicenow.com/bundle/geneva-servicenow-platform/page/administer/localization/task/t_TranslateAClientScriptMessage.html