Comment on page
Multilanguage voice bots
Create voice bots that are support all languages added in your bot.
This documentation will guide you on enabling accessibility in all supported languages through intent recognition and DTMF.
Here are the two options you can use, together or separately, to change the language of a voice bot during a call:
In the example below, we've created an entity called
languageto identify the languages that are available in the bot and have set a value for them:
- en for English
- pt for Portuguese
- es for Spanish
The intent of this example is called 'change language' and is using the entity
There is an internal variable that needs to receive a new value every time the language of the bot should change during a call. It's called
Once the 'change language' intent is recognized:
There is a Go to dialogstate that will capture the value of the entity
languageand use it to inform the new language to the
preferredLanguagevariable. In the screenshot below, if the expression used was "can you speak Portuguese", the
languageentity will assume the value 'pt', as was previewed while creating the entity.
We are using that value to set the condition of the Go to and overwrite the language for the
preferredLanguagevariable with the same language code.
We suggest doing this for every language that is supported by your bot and not just assuming any value that comes with the entity
language. This way the bot will have an accurate response if a user ask for a language that is not supported.
Use an Input validation to save the number informed by the user in a variable.
After that, use a Go to to redirect the users to the next steps while also passing the new value for the
- press 1 for English
- press 2 for Portuguese
- press 3...
The "your new language" dialogstate from the screenshot above will use the translation that matches the language passed on to
Happy bot building and:
en: See you soon
pt: Até logo
es: Hasta luego