Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to translate "Scripted Response" in Virtual Agent?

Junyu
Tera Contributor

Dear all,

 

I am following the doc. to translate for Virtual Agent:

https://community.servicenow.com/community?id=community_article&sys_id=e134c27c1b773c50b09633f2cd4bcbde

 

But I found that it doesn't work for "Scripted Response" (in Virtual Agent -> Languages -> Translations, it doesn't show "Scripted Response" so I can't edit (translate) it).

find_real_file.png

How can I translate the script response?

12 REPLIES 12

Hi Junyu,

Once you set the preferred language in the portal or Native UI, VA can detect your preferred language and convert the message accordingly. 

vaContext.getRequesterLang()  - This detects your pref langu that you have chosen, 

gs.getMessageLang() - Converts the message to your pref lang

(function execute() {

    var tmp = vaInputs.fourth_choice_decision3.getDisplayValue()
   
    return gs.getMessageLang('We only have: \"{0}\" as your next decision, please click \"Yes\" to continue.', vaContext.getRequesterLang(), [tmp]);

})()

Thanks

Hi Murali,

 

Thanks for your reply, no errors have been generated so far.
Next step I want it to be able to translate according to the preferred language, what should I do?

 

By the way, can you show me where is the "VA Web Client" for debug?

 

Try this:

var language = vaContext.getRequesterLang();

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

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

---

LinkedIn
Community article, blog, video list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

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

LinkedIn

Hi @Mark Roethof 

 

Thanks for your reply, no errors have been generated so far.
Next step I want it to be able to translate according to the preferred language, what should I do?

 

By the way, can you show me where is the "VA Web Client" for debug?

Do you mean the debug when testing a topic?

find_real_file.png

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

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

---

LinkedIn
Community article, blog, video list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

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

LinkedIn