- From: Ales Dolecek (Europe) <ales.dolecek@dimensiondata.com>
- Date: Wed, 28 May 2014 23:13:13 +0000
- To: David Wright <David.Wright@OntarioSystems.com>, "www-voice@w3.org" <www-voice@w3.org>
- Message-ID: <35E7D80DA776F5419500EFB9BD0F35FF9CAA7F@EUUKGSLSVEX03.eu.didata.local>
Hello, this can be elegantly solved on the web application server. Once you know the language you submit it to WAS and it shall render further VoiceXML documents with proper language in the <vxml> element. You can have multiple prompts in the document for different languages and only change the root vxml element. Taking your example the server shall output For Spanish: <vxml … xml:lang="es"> … <prompt xml:lang="es"> <s><value expr="'$' + thisAmount"/></s> </prompt> <prompt xml:lang="en"> <s><value expr="'$' + thisAmount"/></s> </prompt> … </vxml> Or for English: <vxml … xml:lang="en"> … <prompt xml:lang="es"> <s><value expr="'$' + thisAmount"/></s> </prompt> <prompt xml:lang="en"> <s><value expr="'$' + thisAmount"/></s> </prompt> … </vxml> The interpreter will play only prompts that match language of the document. Generally: Writing voice application with only static VoiceXML documents is usually not feasible. Maybe fixed menu. But the real-world applications in 99% require dynymic generation of VoiceXML – starting from template documents and filling just little pieces (like above) ending with servers that generate VoiceXML on-fly form dynamic models edited by GUIs. Ales Aleš Doleček Senior Consultant Dimension Data Czech Republic Tel: +420 255 770 737 Mob: +420 737 269 737 Fax: +420 255 770 120 Email: ales.dolecek@dimensiondata.com Na Hrebenech II 1718/10, Praha 4, Czech republic, 140 00, Czech Republic Dimension Data is an NTT Group company. For further information about Dimension Data, please go to www.dimensiondata.com<http://www.dimensiondata.com> Follow us on Social Media Blog<http://blog.dimensiondata.com> Facebook<http://www.facebook.com/pages/Dimension-Data-Europe/208242309194429> LinkedIn<http://www.linkedin.com/company/dimension-data> Twitter<http://twitter.com/DimensionData> P Before printing this email please think about the environment [cid:1f28bb.png@3840cfc4.48b1ce23]<http://www.dimensiondata.com/global/solutions/ucc/index.html> Default Banner From: David Wright [mailto:David.Wright@OntarioSystems.com] Sent: Wednesday, May 21, 2014 8:45 PM To: www-voice@w3.org Subject: Recommendation for xml:lang expressions In a VXML script, I prompt the caller for language and get a result from a <field>. I need a way to programmatically express to all additional <audio> tags in my application that the language selected by my caller (let’s say ‘es’) is to be used for TTS. The <s xml:lang=’es’> works if I wanted to hand-code this stuff and have <if> blocks all over the place to see what language to play the audio in, but I’m too lazy to do this much work. I would really like to have a new attribute in the <s>, <p> and <voice> tags that lets me pass an ecmascript expression that is evaluated and placed into the xml:lang property before sending it over to the SSML engine. As it is right now, in order to read a dollar amount in either Spanish or English, depending on what the caller chose, I have to do this: <if cond="callerXmlLang == 'es'"> <prompt> <s xml:lang="es"> <value expr="'$' + thisAmount"/> </s> </prompt> </if> <if cond="callerXmlLang == 'en'"> <prompt> <s xml:lang="en"> <value expr="'$' + thisAmount"/> </s> </prompt> </if> I also considered using javascript to change the xml:lang attribute on the <vxml> tag, but this would be painful to have to set within every <form> that is called via <subdialog>, since the application context is fresh everytime you use <subdialog>.
Attachments
- image/png attachment: 1f28bb.png
Received on Friday, 30 May 2014 13:52:00 UTC