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

13 lines
437 B

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