04-24-2020 08:12 AM
Hello All,
This is my first time asking a question on Cisco Community, I apologize in advance if I have raised my question with the wrong board, please advise me accordingly.
So I am building a script which has a lot of variables declared as parameters and once I pass the value from application page the script runs fine.
just a note: by documents in my thread i mean XML files
My problem is that I don't understand that how does the Language setting works under Trigger settings, as far as i understand it specifies the repository where the script will look for the files(prompts+documents) specified, so I have selected L[en_GB] there in trigger settings and i have added all of the prompts and documents under L[en_GB] and i have selected the respective prompts and documents on main application page. when the scripts runs and i do a reactive debug i can see that system looks for the prompts in L[en_GB] and for documents it looks in en_US, since the documents are in en_GB i am getting document not found exception.
So my question is, is it normal that documents are supposed to be in L[en_US] all the time? and that setting under trigger is only to give the repository for prompts.
the confusing thing is if instead of declaring variable as parameter and adding value on main application page, I add the value in variable inside the script itself then the system looks for the file in L[en_GB]
I would really appreciate if someone could explain how the standard system is suppose to work. Thank you
Regards,
Masood
Solved! Go to Solution.
04-24-2020 10:30 AM - edited 04-24-2020 12:01 PM
EDIT: I now see what the problem is.
If you have a document parameter, the only way to set it, is with the document selector, which, by default lists every document in your document repository.
There's two problems with it:
1. The UI does not show the full path to the document, thus, the language folder is unclear to the user
2. If a file exists in multiple language folders with the same name, it's only shown once, and the system default language is the "winner" - though, see #1 above, the UI doesn't make this clear
Example:
My en_US and en_GB folders have two files: one uniquely named file, and one generically named file
Now, when I try to set my app param, I see the following screen, where the unique names are shown, but the common name is collapsed into a single entry, hiding it's language parent folder. Though, as your and my testing has proven, the en_US system default language wins. I don't know if it's as simple as that, or if there's some alphabetical sorting going on or what, but it's broken nonetheless, and not a good UX.
If you want to adjust the language in the script to match the trigger, here's what you can do.
Variables
Language contact_language = L[] Document target_document = DOC[]
*Where target_document is an app parameter and set on the web page
Script Steps
/* Read the trigger language setting */ contact_language = Get Contact Info (--Triggering Contact--) /* Override the document language */ Set target_document = target_document @ contact_language
04-24-2020 10:30 AM - edited 04-24-2020 12:01 PM
EDIT: I now see what the problem is.
If you have a document parameter, the only way to set it, is with the document selector, which, by default lists every document in your document repository.
There's two problems with it:
1. The UI does not show the full path to the document, thus, the language folder is unclear to the user
2. If a file exists in multiple language folders with the same name, it's only shown once, and the system default language is the "winner" - though, see #1 above, the UI doesn't make this clear
Example:
My en_US and en_GB folders have two files: one uniquely named file, and one generically named file
Now, when I try to set my app param, I see the following screen, where the unique names are shown, but the common name is collapsed into a single entry, hiding it's language parent folder. Though, as your and my testing has proven, the en_US system default language wins. I don't know if it's as simple as that, or if there's some alphabetical sorting going on or what, but it's broken nonetheless, and not a good UX.
If you want to adjust the language in the script to match the trigger, here's what you can do.
Variables
Language contact_language = L[] Document target_document = DOC[]
*Where target_document is an app parameter and set on the web page
Script Steps
/* Read the trigger language setting */ contact_language = Get Contact Info (--Triggering Contact--) /* Override the document language */ Set target_document = target_document @ contact_language
04-25-2020 04:44 AM
@Anthony Holloway Thanks you so much for your reply. it actually cleared a lot of ambiguity that i had in my mind regarding Language setup. so I have tried the approach you have mentioned:
DOC = DOC @ Language
and it worked like Magic!!!
so since the show documents does not show the full path of the xml we need to specify in the script, strange thing is that it works just fine in case of prompts, but anyways many thanks for your input on this. I really appreciate it.
04-25-2020 08:34 PM
04-28-2020 03:15 AM
Actually I had opened a case with Cisco TAC, it took about a week but they couldn't really get to the bottom of it, that's when you came in and gave me this simple workaround.
By the way if you could answer, how do we reference xml files in a specific folder inside a Language repository from within the script? I am using the upload document step and i want to give the full path including the folder name here under the Language field like L[en_GB]\foldername\ while the system only gives me option to select a Language, may we can do it using expression editor but i don't know the syntax for that. I have attached an image of the step i am using
appreciate your help @Anthony Holloway
Regards,
Masood
04-28-2020 07:56 AM
04-28-2020 05:16 PM
ah alright ... so it was that simple...I'll try that, and thank you so much for sharing the article, good piece of information ...
have a nice day sir ... cheers
Regards,
Masood
04-24-2020 07:27 PM
Here's an alternative response:
When using languages in UCCX, there is a system default at the root. You can find this setting for you system in:
System --> Language Information
Shows the default language set for your system:
If you do not specify a change in language from the default, for any script you write, the 'default' directory for Documents and Prompts is the starting search point.
If the script does not find the document or prompt referenced in your script, it will then search the directories set by the system default language (Named). Or, subsequently, for an alternate language if changed for the Contact in the script.
If you are writing a script and you would prefer the application not use the system default language, then you can change the default language for the specific application at the TRIGGER in the application:
1. Click the link for the Trigger in the Application
2. In the pop-up window, click the drop-down arrow
3. Select a new alternate default language for the Application
4. Save
This will change the default language for contacts calling your application. Alternatively, you can set multiple Triggers (with unique extension) for a given application, and set a default language for that specific trigger. You could then reference different languages by dialed number/trigger.
If you are not writing an application script that needs to change between languages (multi language change from [system default] [en_US] English to [es_US] US Spanish, for example) within the script, then this is the simplest way to change language from the system default. The Prompt names should match, in their respective named language directories, for each language referenced...
The system will still look for documents and prompts in the default directory first, but if none is found, it will search the set language--be it system default or application/trigger defined.
Hope this helps.
-Sean
04-25-2020 04:48 AM
@Sean LynchThank you for your input on this, it was really helpful.
my problem actually was that even if i was specifying the default Language setting under the trigger as en_GB and the file was also inside it, the system was not looking there.
so i used the step mentioned by @Anthony Holloway and it worked.
Thanks for your response. I really appreciate it
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide