Contact usRequest a demo

Translating chat messages

This is a preview feature. It may be subject to change or removal with no further notice.

To enable preview features, set com.unblu.platform.enablePreview to true.

For more information on preview features, refer to the Unblu release policy.

Many organizations operate in markets with more than one language. As a result, agents may deal with customers whose language is different from their own. This can lead to poor communication, resulting in misunderstandings on both sides.

To mitigate this, you can connect Unblu Spark to an online translation service such as Google Cloud Translation API or Azure Text Translation. Unblu Spark uses the translation service to translate chat messages, either automatically or on demand, and displays the translated message to the user. This seamless integration makes conversations a more pleasant experience for users and helps them to feel more confident and comfortable chatting with one another.

Chat translation is also available in the conversation history.

Configuring chat translation

To enable chat translation, first set com.unblu.messenger.translationEnabled to true in the GLOBAL or ACCOUNT scope. Once you’ve done that, you can set the other configuration properties. The latter are also available in scopes further down the configuration cascade.

Enter languages using the BCP 47 language tag format.

Translation service provider

In on-premises installations, you must tell Unblu Spark which translation service provider to use and how to interact with them. This isn’t necessary if you use the Unblu Cloud.

The translation service provider is specified in the GLOBAL or ACCOUNT scope.

Using chat translation

For chat translation to be available for a chat message in a conversation, the following conditions must be met:

  • The language of the message is neither listed in com.unblu.translation.notTranslatedLanguages nor the target language of translation. In other words, Unblu doesn’t translate messages in a language you told it not to translate, and it doesn’t try to translate messages into the same language as the message.

    To determine whether this is the case, Unblu automatically detects the language of the message. For more information, refer to Language detection below.

  • The message type supports translation. At present, this is only the case for text messages.

  • The message was sent by another participant. Users can’t translate messages they themselves sent.

If these conditions are fulfilled, Unblu displays the action for on-demand chat translation.

To trigger automatic chat translation, the following condition must also be met:

  • There mustn’t already be a translation for the message in the target language, that is, Unblu doesn’t translate the same message into the same language more than once.

Agents can determine the language they want messages translated into. For more information, refer to the Language settings section of the Agent Desk guide.

If translation takes place automatically, the only control visitors have over the process is limited to switching between the original message and its translation. If translation takes place on demand, they can trigger the action that translates a message.

When translation takes place

Unblu only asks the translation service provider to translate a chat message if the client—​the user’s browser, for example—​requests it. In the case of automatic translation, this doesn’t happen until the message in question is displayed. How many messages are preloaded for display is configurable.

Translations can be requested at any point in time. In particular, they can also be requested for ended conversations.

Once Unblu receives a translation for a chat message, the translation is persisted in the Unblu database. That way, messages need only ever be translated into a particular language once.

Language detection

To determine whether a message needs translating, the Collaboration Server must first determine which language the message is in.

Messages transmitted using the Unblu web API can provide this information in the locale attribute of the schema used for the message data (TextMessageData, for example).

If the message was sent through an Unblu UI, the Collaboration Server attempts to detect the language that the message is in. To this end, Unblu uses the Lingua library to detect which language the first incoming message of a conversation is written in. It calculates confidence values for the likelihood that the incoming message from an external messenger is in one of a number of languages. If the difference between the confidence values of the two most likely languages falls below a certain threshold, the default account language is used instead.

The threshold for the difference between the confidence values is set with the configuration property com.unblu.externalmessenger.sms.languageDetectionMaximumRelativeDistance.

For a list of the languages Lingua supports, refer to Which languages are supported.

If Unblu can’t detect the language a message is in, it uses the conversation language. If the conversation language changes, the target language of the translation is updated accordingly.

Limitations

At present, chat translations have a number of limitations:

  • Canned responses always appear in the conversation language.

  • Chat suggestions are requested with the message in the original language.

  • Only text messages (TEXT) support translation.

  • System messages aren’t translated.

  • Messages in external messenger conversations can only be translated on the agent side.

  • In conversations, that started before chat translation was introduced, Unblu doesn’t attempt to detect the language that existing messages are in. They’re assumed to be in the conversation language.

  • There’s no way for users to tell whether other users are viewing the original of a message or its translation.

See also