Audium Knowledge Base

Knowledgebase Home | Contact Knowledgebase Home | Contact
Search the Knowledgebase Jump to ID Browse by Category
Developing a multilingual application
Categories: Audium Call Services 3.4.x and 3.5, Audium OpenSDK, Audium Studio (3.4.x)
Article ID: 218
Last updated: March 15, 2007
User Opinions
No users have voted.

How would you rate this answer?
Helpful
Not helpful

SUMMARY

This article describes two methods for developing a multilingual voice application, so that audio files for the caller's chosen language are used at runtime.

SYMPTOMS

Developer would like to know how to create a multilingual voice application.

RESOLUTION

There are two main approaches to developing a multilingual application using Audium software.  One option is to create multiple versions of the application, each configured to work with a particular language.  The other option is to store each set of audio recordings in a different directory, and change the default audio directory (i.e. the currently active audio directory) based on which language the caller chooses.  Regardless of which option is chosen, the voice application's xml:lang attribute should be changed to match the active language, so that the voice browser, ASR engine, and TTS engine are aware of the active language.

For the first option, using multiple language versions of the same application, a dispatch application should be created that prompts the user for a language and then performs an application transfer to the version that matches the caller's choice.  This option is suitable for small applications, where the process of reconfiguring the application several times is not excessive. 

To set the xml:lang attribute properly while using this solution, open the application Properties window, and enter the language under Audium - General Settings -> Language.  Refer to the XML 1.0 specification for valid values of this attribute.

The second option is where the default audio path is changed based on the caller's language choice.  This solution involves the creation of several audio directories, where the audio files in each directory are named consistently (i.e. the same filenames are used in each language's directory).  Then, a custom Action element is created and added to the callflow that modifies the default audio path based on the caller's choice.  This custom Action element need not be complex, its primary purpose is to determine which language the caller chose (e.g. examine an element data variable created by a menu element), and then call setDefaultAudioPath() (from the APIBase class) before exiting as "done".  Additionally, this custom element should change the xml:lang attribute of future VoiceXML pages by calling the setMainDocumentLanguage() method (from APIBase as well).

Another variation of this option is available for those who wish to avoid writing custom Java code.  Since substitution can be used in the URI setting of audio items, a pseudo default audio path can be created.  For example, first set the desired audio path in session or element data. Then, in each element that should use this dynamic audio path, uncheck the "Use Default Audio Path" setting and then insert a substitution before the audio filename.  This substitution should pull the path from the previously created session or element data.  At program execution, this substitution will be replaced by the correct audio path for the chosen language, and the filename will be appended to the end.  This solution also requires that all languages will use the same filenames.

Visitor Comments
  1. Comment #1 (Posted by AudiumVance)
    On a related note, an Audium application's language setting does not effect (and is not intended to effect) grammar element's xml:lang attribute in the app's VoiceXML. However, there are several ways to set this language attribute: 1) If you are using Audium Call Services 3.4.3, you can add a "grammar_default_language" parameter to your gateway adapter's plugin.xml file. This parameter can be used to specify the default language that the gateway adapter will specify in tags. For more information about this new feature, please view the Audium Call Services 3.4.3 release notes, and search for "AC-138". 2) If you are using external grammars that you can modify, include the desired xml:lang attribute value in the grammar itself. This may take precedence over the value in the element, depending on the voice browser being used. If you choose this option, please run tests to ensure it functions as desired. 3) You can create a custom voice element that produces a tag with the xml:lang attribute set to the value of your choosing. The VGrammar class (a Voice Foundation Class from the Audium Java API) includes a setLanguage() method that allows you to specify the language to use for this attribute. Using this, you can create your own custom form that allows you to configure the value for this attribute. This solution will produce the desired VoiceXML, since you have complete control over its output. For more information about the VGrammar class, please refer to the Audium Java API JavaDocs. 4) You can wrap the existing Form element. First, create a custom voice element that extends MFoundationForm. Then, in addXmlBody() call super.addXmlBody() to obtain a VMain object that contains the Form-generated VFCs. Navigate this structure, and call the setLanguage() method on each VGrammar object you encounter. This solution has not been tested and is recommended only for advanced developers. For an example of how to extend MFoundation form and manipulate the VFCs it produces, please download the AdvancedSampleCode.zip archive from our Sample Java Code forum, and refer to ExtendedElementExample.java. Additionally, we have created an issue in our internal issue-tracking system to recommend that future versions of the Form element include a configurable language setting so that the value of elements' xml:lang attributes are easily configurable. If you would like to track the progress of this request, please refer to AE-67 when speaking with your Audium Account Representative.
     
Related Questions
Attachments
No attachments were found.

Copyright (c) 2005 Audium Corporation. All rights reserved.
Audium Home | Audium Support Center Home | Audium Customer Care Home