Languages

The DialoX platform can supports multiple languages in the same Smart App. 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.

Smart App can only support one language at any given time per conversation.

Languages

But first, it is important to understand that languages play a role on three levels:

  • Bot

  • User

  • Conversation

Language of the bot

When configuring your Smart App, you need to define in which languages your Smart App is able to converse. The first language is considered to be the main language of the Smart App. It will fall back to this language when your Smart App doesn't support the user's preferred language.

When working with flows, the main language of the Smart App can be found in the built-in variable Bot language.

Language of the user

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.

Channel
How to determine the language?

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

Whatsapp

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

Facebook

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.

Instagram

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.

Language of the conversation

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 Smart App and take it if so.

if not, it will take the App's main language as the conversation language.

The conversation language is then remembered in the Conversation language built-in variable.

Flow conditions based on language

Flow logic can be made conditional using so called conditions. Read the conditions page 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:

  1. Language tag

  2. Built-in variables

Language tag

Checking the latest language tag will tell you in what language the current conversation is held. See the tags page 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:

Built in variable

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.

Last updated

Was this helpful?