This is the new Docs for Chat SDK v4 for JavaScript. To see the previous Docs, click here.
Auto-translate messages
Using Sendbird's auto-translation feature, you can send text messages in different languages. Set an array of language codes to the UserMessageCreateParams object, then pass the object as an argument to a parameter in the sendUserMessage() method to request messages to be translated in the corresponding language.
As shown in the code below, you can retrieve the translation of a text message by using the userMessage.translations property, which has a Map object containing a language code and the translated message.