Merge branch 'dev' into sync-progressbar

This commit is contained in:
HDDen
2026-05-26 00:44:08 +03:00
45 changed files with 553 additions and 139 deletions
+24
View File
@@ -1580,6 +1580,15 @@ class _ChatScreenState extends State<ChatScreen> {
}
void _showMessageActions(Message message, Contact contact) {
final translationService = context.read<TranslationService>();
final canTranslateMessage =
translationService.canTranslateIncoming(
text: message.text,
isCli: message.isCli,
isOutgoing: message.isOutgoing,
) &&
(message.translatedText?.trim().isEmpty ?? true);
showModalBottomSheet(
context: context,
builder: (sheetContext) => SafeArea(
@@ -1613,6 +1622,21 @@ class _ChatScreenState extends State<ChatScreen> {
_copyMessageText(message.text);
},
),
if (canTranslateMessage)
ListTile(
leading: const Icon(Icons.translate),
title: Text(context.l10n.translation_translateMessage),
onTap: () {
Navigator.pop(sheetContext);
unawaited(
context.read<MeshCoreConnector>().translateContactMessage(
widget.contact.publicKeyHex,
message,
manualTranslation: true,
),
);
},
),
if (!message.isOutgoing)
ListTile(
leading: const Icon(Icons.mark_chat_unread_outlined),