Language is mixed when we select other language on techview

Jeck Manalo
Tera Guru

Hello, 

 

I have a condition that if the user request a ticket and the user language are e.g German, Chinese, French et.c the <Item Name> will make it into english,

 

I impersonate some user with different language and it works when I checked the SCTASK the <Item Name> will make into English. - Working

 

But when I use my account and I change my language in technical view from English to e.g German then the <Item Name> not translated to ENGLISH and stay as a German language. - Not Working

 

Any thoughts ? 

Here's the code below:

 

 

JecksonManalo_0-1679361757157.png

/*
**Access Flow/Action data using the fd_data object. Script must return a value.
**example: var shortDesc = fd_data.trigger.current.short_description;
**return shortDesc;
*/
var lang = gs.getSession().getLanguage(); // puts the user's current language in a variable
gs.getSession().setLanguage("en"); // sets the session language to whatever you want, this one is English
var id = fd_data.trigger.request_item.sys_id; //use your own trigger here, write fd_data.trigger (and then DOT(.), and it will show you your trigger name and item. However it should be close to the same.
var gr = new GlideRecord('sc_req_item');
gr.get(id); //We will look up your item
var item = gr.getDisplayValue('cat_item');
var item = item;
return item;
gs.getSession().setLanguage(lang);

1 REPLY 1

Alex Coope - SN
ServiceNow Employee
ServiceNow Employee

@Jeck Manalo,

Just to confirm, are you referring to a Catalog Item? because you should not need to do this in any code, or are you referring to the subsequent task generated that the fulfiller would view and so are referring to the "short description"?

If it's the latter, then this is typically a good use-case for Dynamic Translation,

Many thanks,
Kind regards

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