Virtual Agent and localization

yundlu316
Kilo Guru

Hi Experts, our team is completely new to Virtual Agent and have a few questions regarding localization.  One of the first questions we want our Virtual Agent to ask is for the user to select their preferred language.  From there we have a Decision Utility that splits off into all the languages we want to incorporate.  Once a user selects Spanish for example, we would like all of the subsequent questions and selections to translate to Spanish. To test this, we currently have a Bot Response - Script Output that looks like this:

find_real_file.png

In the Messages table, we created the following entry:

find_real_file.png

When previewing and choosing Spanish, the Virtual Agent still responds in English:

find_real_file.png

Are we missing any steps to have this return "Hola David!" instead?  Additionally, if we wanted all subsequent questions to be in Spanish, what steps would we need to take to achieve this?  If one of the languages we want to incorporate is not available as a plugin, is it possible to translate as well?

Any guidance on this is greatly appreciated.

1 ACCEPTED SOLUTION

Can you try changing the language under the user settings? Instead of the preferred language field on the user record?

find_real_file.png

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP

---

LinkedIn
Community article list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

View solution in original post

15 REPLIES 15

Muralidharan BS
Mega Sage
Mega Sage

Hi There,

To get the translation in Spanish, the user should have set the language to Spanish. 

to know the language of the user try this - gs.getSession().getLanguage()

 

Try to use this translation instead,

return gs.getMessage('hi there {0}')+vaInputs.user.first_name;

 

Also for translation of topics there plugins are needed - com.glide.i18 and Language plugins

 

Thanks

Mark Roethof
Tera Patron
Tera Patron

Hi there,

What is the why of wanting to work this way? Have you thought of just using the I18N plugins?

Concerning your first image, which shows the scripted message. You could do this, though easier: just using the Input field and adding a data pill. This way you don't need to script anything. Also the script Murali mentioned, really unnecessary. You can just do this with the input field typing your message, and dragging a data pill in between.

If you really want to go for your requirement, asking which language, and then working in that specific language. Is possible, though you would need to script every message! Also be aware, your messages might be translated then, though the rest of the Virtual Agent web client won't be translated.
How you can achieve this: instead of gs.getMessage(), applying gs.getMessageLang(). 

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP

---

LinkedIn
Community article list

 

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

Mark Roethof
Tera Patron
Tera Patron

Hi there,

Did this solve your question? Or do we need to follow-up on this?

Please mark this answer as correct if it solves your question. This will help others who are looking for a similar solution. Also marking this answer as correct takes the post of the unsolved list.
Thanks.

Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP

---

LinkedIn
Community article list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

Hey @Mark Roethof , thanks for this, our team will give gs.getMessageLang() a shot and see what that does.  It was a big oversight on my part to mention that we did indeed activate the Spanish language plug-in, but it sounds like a user would need to already have their language set to Spanish in order for this to work, is this correct?

If that's the case, then having VA ask what their preferred language is as the first question seems pointless.

For languages that do not have a pluging (e.g. Arabic), how would VA work?

Thanks!