Template catalog


Multi language chatbot example using Reply Filters

Very simple multi-language chatbot design using only Reply Filters to implement multi language. It includes pivot-language management

image describing the tiledesk community chatbot

Customize this template quickly & easily with Tiledesk

Designed by

logo of the author of the chatbot published in the tiledesk community

Andrea Sponziello

Published on

21/1/2024

Last update on

22/1/2024

Share this template to:

Try the Chatbot

More about this template

This multi-language chatbot is able to send text in multiple languages based on the browser language.

It uses an approach based on Reply Filters. The basic idea is that you can use some available attribute to "filter" in (or out) some replies' components (i.e. text, images etc.). The Filter feature is available on each reply component.

When we work with languages we can use the user_language attribute that always represents the ISO language of the user on the channel he's using to communicate on Tiledesk.

Take a look at the whole chatbot design. It is made up of four total replies.




  1. Welcome reply (greet the user in three supported languages)
  2. Sales specific welcome message
  3. Support specific welcome message
  4. Fallback message

Each reply is managed "multi language", supporting three total languages:

  1. English (iso code "en"). It also acts as pivot language (the fallback language used when there is no support for the user-language by the chatbot)
  2. Italian (iso code "it")
  3. Spanish (iso code "es")

Focus on the welcome block. It's made up of one Reply action, "composed" by three different messages. Each one is filtered based on the user language got from the communicating channel. We "filtered" each text reply adding a filter condition on each one. The filters are basically all the same, as you can see in the figure, except for the "en" part of the reply. We want english to be also the defalt language so we must add another condition on it useing the special regex "matches" condition".



We used the regex:

^((?!it|es).)*$

We use this regex to get a "true" condition when the user language is different by the other two that we know are supported. As you can see the languages are represented by their iso codes "it" and "es".



If you support other languages different by the pivot one, you should add them here, adding them like in the following example:
^((?!it|es|fr|ru).)*$

In the previous expression we also added support for French (iso code "fr") and Russian (iso code "ru").

Tags

    #multi language

    #pivot language

Integrations

Once designed, you can run your unlimited no-code chatbots on every communication channel of your choosing. Be it WhatsApp, Telegram or Facebook Messenger. With no further clicks or actions.