Add ignored document lang option (#265)
This option allows you to list the locales for which you do not need to apply translation.
This commit is contained in:
parent
6612e49710
commit
7c953f8244
|
@ -137,6 +137,12 @@
|
|||
"secondTargetLangCaptionLabel": {
|
||||
"message": "Select the second target language."
|
||||
},
|
||||
"ignoredDocumentLangLabel": {
|
||||
"message": "Ignore documents in the following languages"
|
||||
},
|
||||
"ignoredDocumentLangCaptionLabel": {
|
||||
"message": "Comma separated languages that do not need to be translated."
|
||||
},
|
||||
"waitTimeLabel": {
|
||||
"message": "Waiting time to translate"
|
||||
},
|
||||
|
|
|
@ -28,8 +28,12 @@ const handleMouseUp = async e => {
|
|||
if (!isLeftClick) return;
|
||||
if (isInPasswordField) return;
|
||||
if (isInThisElement) return;
|
||||
|
||||
removeTranslatecontainer();
|
||||
|
||||
const ignoredDocumentLang = getSettings('ignoredDocumentLang').split(',').map(s => s.trim()).filter(s => !!s)
|
||||
if (!!document.documentElement.lang && ignoredDocumentLang.includes(document.documentElement.lang)) return;
|
||||
|
||||
const selectedText = getSelectedText();
|
||||
prevSelectedText = selectedText;
|
||||
if (selectedText.length === 0) return;
|
||||
|
|
|
@ -39,6 +39,15 @@ export default [
|
|||
options: langListOptions,
|
||||
useRawOptionName: true
|
||||
},
|
||||
{
|
||||
id: "ignoredDocumentLang",
|
||||
title: "ignoredDocumentLangLabel",
|
||||
captions: ["ignoredDocumentLangCaptionLabel"],
|
||||
type: "text",
|
||||
default: "",
|
||||
placeholder: "en, ru, ch",
|
||||
new: true,
|
||||
},
|
||||
{
|
||||
id: "ifShowCandidate",
|
||||
title: "ifShowCandidateLabel",
|
||||
|
|
Loading…
Reference in a new issue