How to translate email script message into Germany
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2025 04:52 AM
Hi Team,
I want to translate email script message. I have tried in Messages(sys_ui_message) module, However it is not working.
I have closed case notification, in that every text got translated, expect email script one. email script is for survey. that survey message is showing in English, Now I want to translate that also into Germany.
below is my email script:
var email_to = gs.getProperty('instance_name')+"@service-now.com";
var out = '<p><span style="font-size: 12pt; font-family: verdana, geneva;">Issue resolved? Take this quick survey!</span></p>' +
'<p><span style="font-size: 12pt; font-family: verdana, geneva;">How did we do? Rate your service experience</span></p>' +
'<p>' +
'<a href="mailto:' + email_to + '?subject=re: ' + current.number + ' CSM CSAT Survey - Very Dissatisfied &body=additional comments (optional):">' +
'<img style="align: baseline;" src="sn_customerservice.VeryDissatisfied-Selected.jpg" alt="Very Dissatisfied" height="auto"/></a>' +
'<a href="mailto:' + email_to + '?subject=re: ' + current.number + ' CSM CSAT Survey - Dissatisfied &body=additional comments (optional):">' +
'<img style="align: baseline;" src="sn_customerservice.Dissatisfied-Selected.jpg" alt="Dissatisfied" height="auto"/></a>' +
'<a href="mailto:' + email_to + '?subject=re: ' + current.number + ' CSM CSAT Survey - Neutral &body=additional comments (optional):">' +
'<img style="align: baseline;" src="sn_customerservice.Neutral-Selected.jpg" alt="Neutral" height="auto"/></a>' +
'<a href="mailto:' + email_to + '?subject=re: ' + current.number + ' CSM CSAT Survey - Satisfied &body=additional comments (optional):">' +
'<img style="align: baseline;" src="sn_customerservice.Satisfied-Selected.jpg" alt="Satisfied" height="auto"/></a>' +
'<a href="mailto:' + email_to + '?subject=re: ' + current.number + ' CSM CSAT Survey - Very Satisfied &body=additional comments (optional):">' +
'<img style="align: baseline;" src="sn_customerservice.VerySatisfied-Selected.jpg" alt="Very Satisfied" height="auto"/></a>' +
'</p>';
current.survey = "0";
current.update();
template.print(out);
Now I want to translate
In Messages table it is not working? Is there any other way to achieve this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2025 05:48 AM - edited 05-28-2025 05:50 AM
Hi @Gopal14
Try using gs.getMessage('issue.resolved.email');
create Message entries in sys_ui_message table with key = issue.resolved.email and text in English and German languages.
For example:
var out = '<p><span style="font-size: 12pt; font-family: verdana, geneva;">gs.getMessage('issue.resolved.email');</span></p>'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2025 01:53 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2025 02:36 AM
Hi Gopal ,
You can use the 'g_lang' variable to get the user language i.e.: g_form.setValue('language',g_lang);
based on that you can use the message translation
Ref my client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2025 03:13 AM
did you create entry into messages table for that message with correct language?
use this to get that message in that particular language
1) get the language of that recipient user
2) then use this to get that message in that language
// determine the language of that recipient user
gs.getMessage("Take the User Satisfaction Survey", null, language);
Also check this
Return a message in a specific language, gs.getMessageLang()
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader