Issue with Translating URL to different language with URL type variable

shyamkumar VK
Mega 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.

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

View solution in original post

9 REPLIES 9

Sai Kumar B
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

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

Hi Ankur,

can you please help me with Sample script

shyamkumar VK
Mega Patron

@Ankur Bawiskar ,

can you please help me with sample script