- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2022 10:59 PM
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.
Regards,
Shyamkumar
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2022 01:09 AM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2022 11:18 PM
Could you try something as below in your variable default value?
For Reference Try
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2022 11:29 PM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2022 11:40 PM
Hi Ankur,
can you please help me with Sample script
Regards,
Shyamkumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2022 11:54 PM
can you please help me with sample script
Regards,
Shyamkumar