- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-29-2023 09:09 AM
Hello all,
As the title says I am trying to localize Push notifications using gs.getMessage(). I have created the messages both in English and Portuguese in System Localization > Messages. Then created the following email script for the request completed Push notification message:
(function runMailScript( /* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */
email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */
event) {
// Add your code here
var msgArray = [];
// Put the dynamic parts of the message in an array
msgArray.push(current.number);
msgArray.push(current.short_description);
template.print(gs.getMessage('request_completed', msgArray));
})(current, template, email, email_action, event);
Then I call it in System Notifications > Push > Push Messages: ${mail_script:request_completed}
However, when triggering the message for a test user that has the language in preferences set as Portuguese, the message is not being sent in Portuguese. Am I missing something?
Best regards,
Diogo
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2023
01:21 AM
- last edited on
09-15-2023
01:02 PM
by
ServiceNow
Hi Diego,
I was trying to achieve a similar or pretty much the same functionality. Based on the info at https://www.servicenow.com/community/international-localization/emails-in-other-languages-easy-to-co... I finally ended up using gs.getMessageLang() function instead and setting the user language depending on the recipient of the language (not dynamically, unfortunately).
I hope it helps!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2023
01:21 AM
- last edited on
09-15-2023
01:02 PM
by
ServiceNow
Hi Diego,
I was trying to achieve a similar or pretty much the same functionality. Based on the info at https://www.servicenow.com/community/international-localization/emails-in-other-languages-easy-to-co... I finally ended up using gs.getMessageLang() function instead and setting the user language depending on the recipient of the language (not dynamically, unfortunately).
I hope it helps!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2023 01:39 AM - edited 04-04-2023 01:40 AM
Hello Diego,
Does your UI message contains parameter like below -
key = 'im_notification_msg' message = 'Message sent to {0} regarding {1}';