From 9869c9dc5bf14d6f7ece3130b3a2b531902691a2 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Sat, 22 Jul 2023 20:30:18 +0800 Subject: [PATCH] If translated text is same as original text, don't show it This means language detection messed up --- src/components/translation-block.jsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/translation-block.jsx b/src/components/translation-block.jsx index 4bbc4da3..ea6af27b 100644 --- a/src/components/translation-block.jsx +++ b/src/components/translation-block.jsx @@ -105,7 +105,11 @@ function TranslationBlock({ }, [forceTranslate]); if (mini) { - if (!!translatedContent && detectedLang !== targetLangText) { + if ( + !!translatedContent && + translatedContent.trim() !== text.trim() && + detectedLang !== targetLangText + ) { return (