Integrating custom translation providers for chats
This functionality is available for Creatio 8.3.2 and later.
Omnichannel chats in Creatio enable real-time communication with customers in different languages. In global or multilingual environments, agents often need to understand and respond to messages written in their native languages. Without built-in translation, this typically requires switching to external tools, which slows down responses and increases the risk of errors.
Since version 8.3.2, Creatio includes built-in support for translating incoming messages in omnichannel chats using Creatio.ai-powered translation. When a client starts a chat, the platform automatically detects the client language and displays it in the Chats sidebar of the communication panel. Chat agents can translate messages into the language specified on the Basic settings tab of the user profile page or select another target language directly in the chat header. After an agent clicks Translate, all subsequent messages in the conversation are translated automatically.
This functionality eliminates the need for external translation tools, speeds up agent response times, and improves the quality of multilingual communication between agents and customers. At the same time, Creatio allows developers to extend the built-in Creatio.ai-powered translation with external services such as DeepL or Google Translate, as well as internal or proprietary translation solutions, without modifying core platform logic.
To implement a custom translation provider for chats, use Creatio's provider-based translation model. All chat translation logic relies on a common contract, and Creatio resolves a concrete provider dynamically at runtime based on configuration. Custom translation providers are executed on the application server and invoked automatically by the chat translation pipeline.
This provider-based approach enables you to:
- Switch translation providers without redeploying application logic.
- Test alternative translation engines in parallel environments.
- Gradually roll out new translation providers.
To integrate a custom translation provider, use the following setup procedure:
- Develop a translation provider.
- Register the translation provider.
- Select primary translation provider.
1. Develop a translation provider
Creatio invokes translation providers through the ITranslateProvider interface that defines how Creatio detects languages and translates chat messages. This interface is the core contract between Creatio chat translation logic and any custom or external translation service. The interface itself does not contain any provider-specific logic. It only defines how Creatio interacts with a translation provider at runtime.
The interface defines the following responsibilities:
- Language detection — an optional capability that enables automatic source language identification for incoming chat messages.
- Single-text translation — the primary operation for translating individual chat messages.
- Batch translation — an optimized mechanism for translating multiple chat messages while preserving their original order.
These responsibilities ensure that Creatio can translate chat conversations efficiently and consistently, regardless of the underlying translation service.
Each translation service is represented by a concrete class that implements ITranslateProvider. The interface below defines the methods that your provider must implement.
/* Interface for a translation provider service. */
public interface ITranslateProvider
{
/* Detects the language of a given text. */
DetectedLanguageResult DetectLanguage(string text);
/* Translates a single text from source language to target language. */
string TranslateText(string text, string targetLanguage, string sourceLanguage);
/* Translates multiple texts at once, preserving the input order. */
IReadOnlyList<string> TranslateMultiple(
IEnumerable<string> texts,
string targetLanguage,
string sourceLanguage);
}
By implementing this interface, your provider becomes interchangeable with any other translation provider supported by Creatio chats. From an architectural perspective, ITranslateProvider isolates external translation APIs from the rest of the platform. All provider-specific concerns, such as authentication, request formatting, error handling, and batching strategies, remain encapsulated within the provider implementation.
2. Register the translation provider
Creatio uses TranslateProviderFactory to resolve translation providers by name at runtime. Each provider, including the built-in one, is registered in the factory with a unique identifier.
Out of the box, Creatio registers the built-in CreatioAiTranslateProvider, which is used for Creatio.ai-powered translation in omnichannel chats. Custom providers are registered in the same way and become available for resolution alongside the built-in provider.
To register a custom provider, add a binding that associates your implementation with the ITranslateProvider interface and assigns it a provider name in the custom schema of the "Source code" type.
View an example that integrates the DeepL provider by binding the DeepLTranslateProvider implementation to the ITranslateProvider interface and assigning it a provider name. The example demonstrates how the implementation encapsulates API authentication, request mapping, and optional batch optimizations.
[DefaultBinding(typeof(ITranslateProvider), Name = "DeepLTranslateProvider")]
public class DeepLTranslateProvider : ITranslateProvider
{
private readonly string _apiKey;
public DeepLTranslateProvider(string apiKey)
{
_apiKey = apiKey;
}
public DetectedLanguageResult DetectLanguage(string text)
{
/* Call DeepL API for language detection. */
return new DetectedLanguageResult("en", 0.95);
}
public string TranslateText(string text, string targetLanguage, string sourceLanguage)
{
/* Call DeepL API for single-text translation. */
return CallDeepLApi(text, sourceLanguage, targetLanguage);
}
public IReadOnlyList<string> TranslateMultiple(
IEnumerable<string> texts,
string targetLanguage,
string sourceLanguage)
{
/* Call DeepL API with batch request if available. */
return texts
.Select(t => TranslateText(t, targetLanguage, sourceLanguage))
.ToList();
}
}
Although individual providers may differ significantly in their internal logic, they all expose the same public behavior through the shared interface. This consistency allows Creatio chat components to treat all providers uniformly.
3. Select primary translation provider
After you register translation providers, specify which provider Creatio should use for chat translation. To do this:
-
Click
in the top right → System setup → System settings. -
Open the "Translate provider name" (
TranslateProviderNamecode) system setting. -
Fill out the system setting properties.
Property
Property value
Default value
Enter code of translation provider that implements the
ITranslateProvider. For example, "DeepLTranslateProvider." -
Click Save.
As a result:
- The selected translation provider will be used for chat translation.
- Creatio will continue to use the same translation entry points.
- The translation provider will handle all communication with the external API.
See also
Chat access (user documentation)
Work with chats (user documentation)