From 6176ef1a980fc17bd3fdfb386a86ab2e1f6c59c9 Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Thu, 30 Mar 2023 18:25:20 -0500 Subject: [PATCH] Message Translation: Disable translation for changelog (#2861) --- .../middle/message/ContextMenuContainer.tsx | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/components/middle/message/ContextMenuContainer.tsx b/src/components/middle/message/ContextMenuContainer.tsx index 0debdbfcf..8b403ba21 100644 --- a/src/components/middle/message/ContextMenuContainer.tsx +++ b/src/components/middle/message/ContextMenuContainer.tsx @@ -25,8 +25,16 @@ import { selectStickerSet, } from '../../../global/selectors'; import { - isActionMessage, isChatChannel, - isChatGroup, isOwnMessage, areReactionsEmpty, isUserId, isMessageLocal, getMessageVideo, getChatMessageLink, + isActionMessage, + isChatChannel, + isChatGroup, + isOwnMessage, + areReactionsEmpty, + isUserId, + isMessageLocal, + getMessageVideo, + getChatMessageLink, + isServiceNotificationMessage, } from '../../../global/helpers'; import { SERVICE_NOTIFICATIONS_USER_ID } from '../../../config'; import { IS_TRANSLATION_SUPPORTED } from '../../../util/windowEnvironment'; @@ -572,6 +580,7 @@ export default memo(withGlobal( const isScheduled = messageListType === 'scheduled'; const isChannel = chat && isChatChannel(chat); const isLocal = isMessageLocal(message); + const isServiceNotification = isServiceNotificationMessage(message); const canShowSeenBy = Boolean(chat && seenByMaxChatMembers && seenByExpiresAt @@ -603,7 +612,8 @@ export default memo(withGlobal( const canTranslateLanguage = !detectedLanguage || !doNotTranslate.includes(detectedLanguage); const canTranslate = IS_TRANSLATION_SUPPORTED && isTranslationEnabled && message.content.text - && canTranslateLanguage && !isLocal && !isScheduled && !isAction && !hasTranslation && !message.emojiOnlyCount; + && canTranslateLanguage && !isLocal && !isServiceNotification && !isScheduled && !isAction && !hasTranslation + && !message.emojiOnlyCount; return { availableReactions: global.availableReactions,