Assistance with translating info messages

SMuir
Mega Guru

I have added an info message via 2 separate Catalog UI policys as follows;

Conditions

Member Firm | Is | London

and

confirm_policy | is |   No

Selected Advanced and selected the Run Script checkbox

Script

function onCondition() {{return g_form.addErrorMessage('Please confirm you have read the Global cyber security and information assurance policy. Select Yes to confirm.');}}

I then created another UI policy for french users

Conditions

Member firm |   is France

And

confirm_policy | No

function onCondition() {return g_form.addErrorMessage('Veuillez confirmer que vous avez lu la Politique sur la cybersécurité. Sélectionnez Oui pour confirmer. ');}

When I test as a London user and Select no, the message appears as expected (GREAT!)

The same with a French user and it shows the french message (GREAT!

PROBLEM

When selecting a French/London user where the location is France and testing it.   It gives the French Message instead of English.

What we want is that

- French London users show a English message

- French users show a french message

- London Users show and English message.

Can anyone suggest a script change that will work on the UI Policy.

Much apreaciated in advance!

Sarah

1 ACCEPTED SOLUTION

Thanks so much Chuck,



I have just changed it to 'No' and it's working now for English, French and French/English users.








Final script (working as expected)



function onChange(control, oldValue, newValue, isLoading, isTemplate) {



var cyber_policy = g_form.getValue('cyber_policy');



if (isLoading || cyber_policy == '') {


return;


}


if (cyber_policy == 'No') {


g_form.addErrorMessage(getMessage('cyber_policy'));


}


}



Thanks so much for all your help on this Chuck. Really appreciate it!



Regards


Sarah


View solution in original post

13 REPLIES 13

I suspect it is the value of the cyber_policy variable that is throwing us off. Let's add a little debugging statements to see what is happening. Let me know.



function onChange(control, oldValue, newValue, isLoading, isTemplate) {



        var cyber_policy = g_form.getValue('cyber_policy');


        alert('cyber_policy=' + cyber_policy);



        if (isLoading || cyber_policy == '') {


                  return;


        }


        if (cyber_policy == 'false') {


                  g_form.addErrorMessage(getMessage('cyber_policy')); //Also kept it as confirm_policy but this did not work either.


        }


}


It says



cyber_policy =


prevent this message from creating additional dialogs


OK button


Thanks Sarah. It looks like either The Cyber policy variable is empty, or we're using the wrong name. Can you go to the catalog item variables and verify that's the name (not the label) of the variable in use?


Appreciate the help Chuck



The name is cyber_policy


Screen shot if that helps. ☺