Use Multi-language Translation to chat with more users in their preferred languages

Enabling Certainly's Multi-language Translation feature allows your bot to chat with customers in any language supported by your chosen translation provider.

Using a third-party API, messages are translated between your bot's default language and the user's language, all in real time and without having to maintain any additional AI Models. Currently, we support Google Cloud Translation and DeepL.

A translation service account is required for this feature. The quality of the translated content and the number of supported languages depends on the provider you select.

Please refer to our terms and conditions for more info on third-party integrations.

In this article, we'll explore the following topics:

Have another preferred translation provider? Let our Customer Success team know! We are open to suggestions for future iterations of this feature.

How to enable Multi-language Translation

The process of connecting your bot to the third-party translation service requires just a few steps, which we'll share below.

  1. Using the right sidebar menu of the bot-building canvas, navigate to Bot Settings.

  2. Under “Multi-language Translation”, select “Enable”.
    enablemltdraft

  3. In the "Connect to translation API" modal window that appears, do the following:
    • Using the first drop-down menu, identify which translation API you'll use: Google Cloud Translation or DeepL.
    • In the second menu, select your bot's default language (that which you build your bot in and use in the AI Manager).
    • In the text entry field, add your Translation API Key. Refer to Google's or DeepL's translation API documentation for help finding it.
      multilanguageconnect
  4. Select "Connect". Once you've successfully connected to the translation API, your view in Bot Settings will look similar to this:
    multilanguageset 
    To remove the connection, simply select the “X” button. This will disable the Multi-language Translation feature.

Defining the source language

The Multi-language Translation feature is not set to autodetect the user's language by default, as there may be cases where you want to avoid automatic language swapping. For example, if a customer's reply is very short or uses a word found in multiple languages, the result may be a misidentification of the language.

As such, after you've enabled Multi-language Translation in Bot Settings, you'll need to define the source language using the user_language Custom Variable (CVar) at the beginning of your desired flow(s).

Below, we explore three possible methods:

Use Certainly's Web SDK or Webhooks to define the source language

You can use Certainly's Web SDK or Webhooks to fill in the user_language CVar using, for instance, one of the following:

  • browser language
  • IP address
  • user data from your CRM

The defined language is then used as the translation conversation language moving forward. To swap languages, this user_language CVar value will need to be overwritten using one of these methods at another point in the flow.

For example, the following Web SDK function enables you to retrieve the browser’s locale. The returned value is then split to only show the locale code, which can be saved in the user_language CVar.

   function getBrowserLocale() {
    //if ( language && language.length > 0 ){
    //  return language;
    //}
    return navigator.language.split(/-|_/)[0];
   }

Allow users to manually select the source language

Another option is to directly ask the user which language is preferred and set the user_language CVar with their choice.

Remember that the language options you offer to users must be supported by your chosen translation provider to ensure successful translation.

Here, the language options are presented via Suggested Replies in the Message tab:

setuserlang1

In the Connections tab, the user_language CVar is set with the corresponding language code:

setuserlang2

The selected language is then used as the translation conversation language moving forward. To swap languages, this user_language CVar value will need to be overwritten using one of these methods at another point in the flow.

Customizing the translation output

There may be cases where you wish to alter the translation output or hard-code selections.

Both Google Cloud Translation and DeepL offer the possibility to customize the translation model as an advanced feature. Please refer to their documentation for more information.

Limitations

In this section, we'll address the following limitations:

Please contact our Customer Success team if you face any difficulties related to these limitations or have other questions about our Multi-language Translation feature.

Translation application

Translation will not apply to Dynamic Cards, Markdown, alt-text, or the "write text" input placeholder and error messages.

Markdown formatting

Markdown tags may be removed from short messages (1-2 word strings) depending on the translation provider you select. In these cases, some styling, like italics, can be lost in translation.

Reporting

Conversations in the Inbox and Message Reports will be recorded in the language in which the bot is set up. Currently, it is not possible to see the detected language in Reporting. We plan to include this in a future iteration, along with the ability to segment the data accordingly.

DeepL partial translation

When using DeepL as your third-party translation provider, partial translation may occur in some cases. This break in translation tends to happen after the following:

  • the use of a semicolon (;), colon (:), dash (—), or hyphen (-)
  • the start of a new line (line break)

To increase the chance of correct translation, we recommend capitalizing the first word of sentences that follow the instances noted above.