Table of Contents

Managing Languages and Translations

effective communication requires speaking your user’s language. In this section, you will learn how to set up CHAT.devad.io to automatically detect user preferences or force specific language settings via URL parameters and WordPress configurations. We also explain how to translate knowledge base articles, customize specific text strings, and even add support for entirely new languages by editing system files.

Language Settings

  • You can add new article translations by opening an article. Click the + icon on top right and select the language you want to translate the article into. To delete a translation, hover the language flag icon and click the trash icon.
  • You can add new category translations by opening a category. Click the + icon on top right and select the language you want to translate the category into. To delete a translation, hover the language flag icon and click the trash icon.
  • You can enable automatic translation of articles and categories by activating both the multilingual via translation feature and Settings > Articles > Language > Automatic translation. You also have to set the default language of your articles from Settings > Articles > Language > Default language. The language used for the automatic translation is the user’s language detected by CHAT.devad.io. You can also force a specific language by adding the URL parameter lang=LANGUAGE-CODE.
  • The language menu is shown at the bottom of the article. It shows all the available translations of the article.
  • If there is at least one translated article in the user’s language, only the translated articles are displayed in the category page or main page. Otherwise, all articles are displayed in the original language.
  • Force the articles page to be shown in a specific language by adding the URL parameter lang=LANGUAGE-CODE. Replace LANGUAGE-CODE with the two-letters language code.

More information

  • If you use categories, all the articles must be assigned to a category.
  • You can create an internal chat link to an article with the button rich message.
  • You can create a link to a specific article with the URL attribute article=ID, replace ID with the article ID. Example: https://chat.devad.io/articles-demo?article=Ucsx6.
  • You can create a link to an article category with the URL attribute category=ID, replace ID with the category ID. Example: https://chat.devad.io/articles-demo?category=LnNaZ.
  • The articles are always included into the training of your OpenAI chatbot. If you update an article, you’ll need to train the chatbot again, the process isn’t automatic.
  • If some block is not saved, e.g. text block, disable all browser extentions and try again.
  • To hide the chat widget insert the following code into the articles page: <script>var SB_DISABLED = true;</script>.

Language and translations

CHAT.devad.io is fully multilingual and provides powerful features to detect the user’s language on the fly.

Chat language

CHAT.devad.io is already translated into 45+ languages. There are many options available to set the language:

  • OPTION 1 Go to Settings > Chat and check the Language option. Set it to multilingual to automatically use the chat language of the user’s browser or the language saved in the user profile.
  • OPTION 2 Add the URL parameter lang=LANGUAGE-CODE to the script that loads the chat, replacing “LANGUAGE-CODE” with the two-letters language code you would like to display. E.g. or https://chat.devad.io/account/js/init.js?id=123456&lang=es for the cloud version. This feature will force the chat to always use the same language and the Settings > Chat > Language option will be ignored. Go to wikipedia.org/wiki/List_of_ISO_639-1_codes for the complete languages code list (see column 639-1). For Traditional Chinese use zt, for Simplified Chinese use zh, for Brazilian Portuguese use pt.
  • OPTION 2 – WORDPRESS ONLY Go to Settings > WordPress and set the option Force language. This feature will force the chat to always use the same language and the Settings > Chat > Language option will be ignored.
  • OPTION 3 – WORDPRESS ONLY The WordPress version of CHAT.devad.io uses the default language of the WordPress installation; or the language of the current page or post if the website is multilingual. This feature is compatible with WPML, Polylang, and other multilingual plugins. This feature is automatically disabled if the Settings > Chat > Language option is active.

Admin language

To translate the admin area follow the steps below:

  • Translate the texts in your language from the Settings > Translations.

To set the admin area language you have three options:

  • Activate the option Settings > Admin > Automatically translate admin area. This feature automatically translate the admin area to match the agent profile language or the agent browser language.
  • Edit the file config.php inside your CHAT.devad.io installation directory and Enter the code define(‘SB_ADMIN_LANG’, ‘LANGUAGE-CODE’); at the end of the file content. Replace LANGUAGE-CODE with the language code of the language you want to use, use only 2 letters, for example, insert only es, not es_ES. This option is not available in the cloud version.

Chatbot and message translations

To automatically translate chatbot messages and other texts, use the Artificial Intelligence app and follow the steps outlined here.

Edit and add new translations

You can translate almost any custom content like rich messages, built-in messages, departments, chat header, and more. To add a new translation or edit and existing translation, follow the steps below:

  • Go to Settings > Translations, if you want to add a new translation, click New translation.
  • Enter the English content you wish to translate in the first field. The original text must be in English. If the original text has breaklines, replace them with the n code.
  • Enter the corresponding translation in the second field. To add breaklines, use the n code.
  • If you have the artificial intelligence app you can also translate all contents to any language automatically through the multilingual via translation feature.

Add a new language

To add a new language, follow the steps below:

  • Via FTP or a File Manager, go to scriptresourceslanguagesfront.
  • Duplicate (copy and paste it in the same directory) the scriptresourceslanguagesfrontsource.json file.
  • Rename the file with the language code you would like to add. Go to wikipedia.org/wiki/List_of_ISO_639-1_codes for the complete languages code list (see column 639-1).
  • Go to Settings > Translations and the new language should appear automatically.

To add a new language for the admin area, follow the exact same steps, but use folder admin instead. New languages will not be lost or deleted on plugin updates.

More Information

  • If a translation string is missing, add it by clicking the button Add new translation.
  • If a translation string is not working, make sure to remove all white spaces and break lines at the start and the end of the string.
  • The translations edits are not saved in the database but directly in the translation files. When a translation is edited, and saved, a backup is created into the uploads folder. The backup is restored automatically on plugin update and plugin activation.
  • Some special chars like & are replaced by the HTML equivalent code (see https://www.w3schools.com/html/html_entities.asp). Ex. & is replaced by &amp;.
  • You can add missing translation strings also by code. Edit the language files located in scriptresourceslanguages. After editing a file, the new strings will be visible under Settings > Translations. Remember to click Save changes in order to preserve your translations and avoid losing them when CHAT.devad.io is updated.

Multilingual chatbot

The feature Artificial Intelligence > Google > Multilingual checks if there is a Dialogflow agent in the user’s language and activate it.

  • For this feature to work the user language must be know. The user language is based on the language user detail of the user if set, otherwise on the user browser language. The language can also be detected with the language detection feature.

Automatic translation

The automatic translation feature automatically translates user messages into agent language and agent messages into user language. To enable it check the option Settings > Artificial Intelligence > Automatic translation. If you are using the cloud version and Artificial Intelligence > Google > Sync mode is set to Automatic, the multilingual features will work automatically. Otherwise you have to complete the synchronization and the setup below. The multilingual via translation and language detection features also require these steps.

Cloud Translation Setup

  • Log in to https://console.cloud.google.com with your Google account and select the project of your Dialogflow Agent.
  • On the top search bar type cloud translation, select the Cloud Translation API service and enable it. Please note that this is a paid service with a free tier, additional charges may occur.
  • Enable the billing by clicking Left menu > Billing and by enabling a billing account with a valid payment method.

More Information

  • The user messages in the admin area are translated automatically in real-time to match the agent language.
  • The agent messages are translated automatically in real-time to match the user language.
  • Agents can view the original message by opening the message menu and by clicking View original message.
  • The agent language is based on the language user detail of the agent if set, otherwise on the browser language, or admin area language.
  • The user language is based on the language user detail, if set, otherwise on chat language, if set, otherwise on the browser language. The language can also be detected with the language detection feature.
  • The notifications are also translated.
  • To avoid translating a string, enclose it with the characters ` or “`.

Multilingual via translation

The feature at Settings > Artificial Intelligence > Multilingual via translation automatically translates user messages into the default language of Dialogflow or OpenAI, and translates Dialogflow or OpenAI messages into the language spoken by the user. Additionally, this feature translates all text displayed within the chat, such as the chatbot’s rich messages, articles, registration forms, and pop-up notifications. To enhance performance and minimize translation costs, the translations are automatically integrated into the translation files. Combine this feature with the language detection feature for optimal results.

  • If English is one of the languages, English must be the default language, the original texts must be in English.
  • If you are using OpenAI with training data, set the default training data language under Settings > Artificial Intelligence > OpenAI > Training Sources Language. Leave it as default if the training data default language is in English.

Language detection

Detect the language of the user’ messages and change the user language and Dialogflow agent language accordingly, if available, otherwise, show a fallback message. You can use the following merge fields in the message: {language_name}.

  • The user message must be at least 2 words long.
  • Language detection is executed only for the first 2 user messages of a conversation.
  • As long as the OpenAI chatbot is operational and programmed to respond to generic inquiries, the fallback message will never be dispatched, since OpenAI will consistently provide answers to any use message.
  • The supported AI features include language detetction, spelling correction, multilingual via translation, Google search.

Categorized in:

CHAT App, Settings Area,

Tagged in:

,