Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
New Member

Converting from a string variable to a language variable

Is there a way to convert from a variable of type string to a variable of type language in a UCCX script?

What I'm trying to do is to read a list of language supported by a specific customer service script from an XML file (the variables will be in the valud "en_US" or de_DE" format).  This is to avoid making changes in the script every time new language support is added or removed (customer can just modify the XML file).  Then inside the script I want to convert the string value to the language value (i.e., "en_US" to "L[en_US") and put the latter into Set Contact Info step, etc.

I can't find a language method that would work in this situation.

Any help would be appreciated.

Thanks a lot

Pavel

1 ACCEPTED SOLUTION

Accepted Solutions

I found away using the

I found away using the Language constuctor: new Language(String[, String[, String]])

Sample:

Anthony Holloway

Please use the star ratings to help drive great content to the top of searches.
4 REPLIES
VIP Super Bronze

I'm not aware of a method for

I'm not aware of a method for this. What about:

myLanguage = "L[" + myString + "]"

New Member

None of my testing was able

None of my testing was able to do this. Would setting the language on the trigger instead work? At that point you can get the current language as a language, and that is pretty easy to convert to a string if you need it in that format.
--------------------------------- Please rate helpful posts Visit me a http://www.routeswitchblog.com

I found away using the

I found away using the Language constuctor: new Language(String[, String[, String]])

Sample:

Anthony Holloway

Please use the star ratings to help drive great content to the top of searches.
New Member

Anthony, Thank you very much

Anthony,

 

Thank you very much for your reply and a great example.  It was unclear to me at first why you had to use an array.  After testing it both ways (1 - by providing my_array into the my_language = new Language constructor and 2 - by providing my_string string variable), I realised that using the string variable results in a language variable being all lower case (L[fr_fr] instead of L[fr_FR]), and apparently UCCX does not treat that as a valid language and defaults to US English (in my case at least, since it is the default).

Thanks again, this constructor works seamlessly at converting string to language.

Pavel.

82
Views
0
Helpful
4
Replies
CreatePlease to create content