Push notifications translation

michal_v
Giga Contributor

Hey all,

Did any one ever implemented translation for push notifications?

Meaning that the push notification will display in the language that is set in the receiver profile (on the user preferences)

Thanks in advance

6 REPLIES 6

Hi @Ramiro Rincon B I tried using this method you suggested but it is not working for me. The push notification is still showing up in English for users with different locations. Did you manage to get it to work on your end? The mail_script I used is as follows:

 

(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);

 

Javier Dom_nech
ServiceNow Employee
ServiceNow Employee

Hi, I have been able to make translations for push notifications by following the info in this link: https://www.servicenow.com/community/international-localization/emails-in-other-languages-easy-to-co....
So basically, I used {mail_script} functionality to be called from the push notification message field.

This way, I can use the function gs.getMessageLang() from the script, and get the notification automatically translated.

I hope it helps!