You can add a feature to your app to translate select messages into other languages. Using the translateUserMessage() method, you can translate a text message already sent to a channel into the desired languages based on your own needs. To enable this feature, contact our sales team.
// The USER_MESSAGE argument below indicates a UserMessage object
// which represents an already sent or received text message.
try {
final message = await channel.translateUserMessage(
USER_MESSAGE, ['es', 'de']
);
final esTranslatedMessage = message.translations[‘es’] // Spanish
final deTranslatedMessage = message.translations[‘de’] // German
} catch (e) {
// Handle error.
}
// Display translations in the UI.