09-06-2015 07:42 PM - edited 03-14-2019 03:11 PM
Hello Experts,
I am trying to write a script which will support 2 different languages. As soon as I try to add the "if" statement the script validation fails. Is there anything that I am missing? Please find attached a picture of the script.
Thanks for your help,
MK
09-07-2015 06:03 AM
Hi Mightyking,
You need a condition in your "If", based on the calling number or whatever.
However if the caller is able to change the language you're better to use another "menu" step instead the "if". put the menu step into the branch "ChangeLanguage" with a prompt like "for french press one, for english press two" and then make two branche French / English.
Regards,
09-07-2015 08:15 AM
Hi Julien,
The condition in my "If", is if the caller presses 1 to change the language and I believe that should work. In the main menu prompt, I am offering the caller the option to chose the language and don't want to make another menu and prompt to repeat that again. How can I make the "If" statement work. At the beging of the script I am setting the contact info (language) to French and asking in the main prompt if the caller desires to change the language to English.
Thanks,
MK
09-08-2015 08:18 AM
Ah do you mean that whenever the langage, when the caller press the button (say one if "changeLanguage" Branch is affected to one) it switch the language.
I believe that if you initialize bEnglishSpeaker to False and set your condition to (bEnglishSpeaker== true), it should work.
However to have something easier to read, maybe you can use a String and do something like this
//Initialize your variable lang at the beggining of the script
lang = "FR"
set contact Info()
.........
// in the branch of your menu Step, instead the "if", use a switch :
switch(lang)
case "FR"
lang = "EN"
set contact Info()
case "EN"
lang = "FR"
set contact Info()
09-08-2015 12:53 PM
Thanks Julien,
Will test that and let you know.
Regards,
MK
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: