How to specify user's language in email script

Aishwarya20
Tera Contributor

Hi,

1. whenever we using ${field name} its showing Norwegian language, because its taking system default language that is Norwegian. is there any option to translate the language.
2. How to specify the user's language in email script? because in notification we are using email script and that is also showing system default language.

We created two separate notifications for Norwegian and English by specifying the condition, still its taking systems language whenever we using ${field}.

find_real_file.png

9 REPLIES 9

-O-
Kilo Patron
Kilo Patron

For messages you can use the API call:

var to_translate = 'Snow White is a {0}';
var language = 'de';
var parameter_arr = ['fairy tale'];

gs.getMessageLang(to_translate, language, parameter_arr);

Assuming the translations exist, this will return

Schneewittchen ist ein fairy tale

For field names, choices and translated texts and translated fields you need to use a GlideRecord lookup.

-O-
Kilo Patron
Kilo Patron

Clarification: that means you can't use ${field} tokens, you need to use notification e-mail scripts instead.

Aishwarya20
Tera Contributor

No, I can use ${field} but its showing system default lanuage not an english.

When one says "you can't use" it does not necessarily mean that you will be unable to use, but it can also mean that you will be able to use, but it will not work.

So let me restate it: You will not be able to achieve translating things added to an e-mail using ${field} tokens, you have to use notification e-mail scripts instead.

Alex Coope - SN
ServiceNow Employee
ServiceNow Employee

Aishwarya, 

I actually posted about this very topic in a recent post on my blog here,

Many thanks,
Kind regards

--------------------------------------------------------------------
Director of Globalization Deployment, Internationalization