How I can translate incoming message? I have made a plugin that listen on messageAdded event but I can't see the incoming message translated.
This is my code
chat.plugins.add('translate', {
initialize: function () {
var _converse = this._converse;
_converse.on('pluginsInitialized', function () {
_converse.on('messageAdded', function (data) {
//console.log(JSON.stringify(data));
let message = data.message;
if(message.attributes.message) {
message.attributes.message = "test";
console.log(message.attributes.message);
console.log(data.chatbox);
}
});
});
}
});
I can modify text message but the translated message is not displayed in chatbox