Issue with Translating URL to different language with URL type variable

shyamkumar VK
Kilo Patron

Hi All ,

I had created variable type "URL" and Included URL in default , this is working fine for English language.

when we switch to Another language Question label is getting translated but URL is not getting translated 

NOTE : we have two different URL's for English and French 

I had changed label of French by switching to French language in portal and pasted the Translated French label in the variable

can anyone help with Inputs here.

Please mark this as helpful and accept as a solution if this resolves your Ask.
Regards,

Shyamkumar
1 ACCEPTED SOLUTION

Hi,

don't use gs.getMessage() if you have not created any record in messages table

use this as default value

javascript: gs.getUser().getLanguage() == 'en' ?  'https://www.google.com' :  'url in spanish'

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

9 REPLIES 9

Sai Kumar B
Mega Sage
Mega Sage

@shyam 

Could you try something as below in your variable default value?

For Reference Try @Narsing response from this community link - Translation for Catalog Variable 'Default Value' and 'Help Text' Instructions

find_real_file.png

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

2 approaches

1) Default value script - shared by Sai

you can use this script in default value to get logged in user's language

OR

2) onLoad client script

-> determine language of user and set the URL accordingly

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi Ankur,

can you please help me with Sample script

Please mark this as helpful and accept as a solution if this resolves your Ask.
Regards,

Shyamkumar

shyamkumar VK
Kilo Patron

@Ankur Bawiskar ,

can you please help me with sample script

Please mark this as helpful and accept as a solution if this resolves your Ask.
Regards,

Shyamkumar