From 44c1cb37f5ade94e24aecf1cf79ba7b7b762e49e Mon Sep 17 00:00:00 2001 From: sienori Date: Thu, 15 Nov 2018 21:51:46 +0900 Subject: [PATCH] Do not judge language when "dontShowButton" option is enabled --- simple-translate/simple-translate.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/simple-translate/simple-translate.js b/simple-translate/simple-translate.js index 6087c54..3e36f33 100644 --- a/simple-translate/simple-translate.js +++ b/simple-translate/simple-translate.js @@ -38,8 +38,9 @@ async function Select(e) { const shouldTranslate = existsSelectionWord && isLeftClick && isPanelOutside; if (!shouldTranslate) return; - //選択した言語が翻訳先言語と異なれば翻訳する - if (S.get().ifCheckLang) { + //選択した言語が翻訳先言語と異なるか判定 + const shouldShowButtons = S.get().whenSelectText != "dontShowButton"; + if (S.get().ifCheckLang && shouldShowButtons) { const shouldTranslate = await checkLang(selectionWord, "auto", S.get().targetLang); if (!shouldTranslate) return; }