The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/app/autotranslate/server/methods/translateMessage.js

16 lines
447 B

import { Meteor } from 'meteor/meteor';
import { Rooms } from '../../../models';
import { TranslationProviderRegistry } from '..';
Meteor.methods({
'autoTranslate.translateMessage'(message, targetLanguage) {
if (!TranslationProviderRegistry.enabled) {
return;
}
const room = Rooms.findOneById(message && message.rid);
if (message && room) {
TranslationProviderRegistry.translateMessage(message, room, targetLanguage);
}
},
});