Languages
Last updated
Was this helpful?
Last updated
Was this helpful?
The DialoX platform can support multiple languages on the same bot. There are multiple ways to configure your flows to allow users to switch language and/or allow for conditional behaviour based on the language of the conversation.
But first, it is important to understand that languages play a role on three levels:
Bot
User
Conversation
When , you need to define in which languages your bot is able to converse. The first language is considered to be the main language of the bot. It will fall back to this language when your bot doesn't support the user's preferred language.
When working with flows, the main language of the bot can be found in the built-in variable Bot language.
When the user engages with DialoX, the system will try to identify the language of the user as best as possible using channel specific logic.
Phone
The user language will be derived from the country codes of the ISO 164 phone number format. When multiple languages are possible in any given region, it will pick the most dominant language.
Initially same as for phone, but then takes the first user message (when it is a complete sentence) to detect the real preferred language of the user.
Web
The user language will be derived from the browser settings.
The user language is provided by the Facebook platform, but then takes the first user message (when it is a complete sentence) to detect the real preferred language of the user.
The user language is provided by the Instagram platform, but then takes the first user message (when it is a complete sentence) to detect the real preferred language of the user.
The preferred language of the user will be stored in the built-in variable labeled as User language.
When the conversation starts, the platform will first try to identify the language preference of the user, see the paragraph above.
Then it will determine if this language is supported by the current bot and take it if so.
If not, it will take the bot's main language as the conversation language.
The conversation language is then remembered in the Conversation language built-in variable.
Language tag
Built-in variables
As you have been reading in this article there are three built-in variables that represent a language. The language used in the current conversation is available as Conversation language in the Variables side panel. It will hold the ISO 639 representation of the language code of the language that is currently active for this conversation, like 'nl', 'en', 'de', etc.
Using the expression builder you can define a condition that compares the value of this variable to a given language code. In the below example it will check if the current conversation is held in Dutch OR in English.
Flow logic can be made conditional using so called conditions. Read the for more information about this topic. Flow conditions can use either tags or variables. For conditional logic based on the current conversation language this means:
Checking the latest language tag will tell you in what language the current conversation is held. See the for more information about these tags. These tags can be used to build a condition that evaluates to true when the conversation language is part or isn't part of the list of language tag that you provide in the below expression builder: