translateMessage method

Future<void> translateMessage(
  1. Message message, {
  2. bool showTranslate = true,
})

Implementation

Future<void> translateMessage(Message message,
    {bool showTranslate = true}) async {
  Message msg = await ChatUIKit.instance.translateMessage(
    msg: message,
    languages: [ChatUIKitSettings.translateTargetLanguage],
  );

  if (showTranslate) {
    msg.setHasTranslate(true);
  } else {
    msg.setHasTranslate(false);
  }

  await ChatUIKit.instance.updateMessage(message: msg);
  _replaceMessage(msg);
}