From 21f16c00af4795c6f723ae7a6180ab159168cdb0 Mon Sep 17 00:00:00 2001 From: sienori Date: Mon, 8 Mar 2021 23:25:44 +0900 Subject: [PATCH] Organize disable translation options --- src/_locales/en/messages.json | 9 ++++-- src/settings/defaultSettings.js | 51 +++++++++++++++++++-------------- 2 files changed, 35 insertions(+), 25 deletions(-) diff --git a/src/_locales/en/messages.json b/src/_locales/en/messages.json index acf2fe1..1915bfe 100644 --- a/src/_locales/en/messages.json +++ b/src/_locales/en/messages.json @@ -89,6 +89,9 @@ "ifChangeSecondLangOnPageCaptionLabel": { "message": "Detects the language of the selected text, and if it is the same as the default target language, translate it into the second language." }, + "disableTranslationLabel": { + "message": "Disable translation" + }, "isDisabledInTextFieldsLabel": { "message": "Disable translation in text fields" }, @@ -138,10 +141,10 @@ "message": "Select the second target language." }, "ignoredDocumentLangLabel": { - "message": "Ignore documents in the following languages" + "message": "Disable translation by lang attribute" }, "ignoredDocumentLangCaptionLabel": { - "message": "Comma separated languages that do not need to be translated." + "message": "Disable translation if the lang attribute in the html element of the page matches the list. Enter comma-separated language tags." }, "waitTimeLabel": { "message": "Waiting time to translate" @@ -365,4 +368,4 @@ "openPopupDescription": { "message": "Open toolbar popup" } -} +} \ No newline at end of file diff --git a/src/settings/defaultSettings.js b/src/settings/defaultSettings.js index 9c0c26e..f381902 100644 --- a/src/settings/defaultSettings.js +++ b/src/settings/defaultSettings.js @@ -39,15 +39,6 @@ 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", @@ -145,19 +136,35 @@ export default [ default: false }, { - id: "isDisabledInTextFields", - title: "isDisabledInTextFieldsLabel", - captions: ["isDisabledInTextFieldsCaptionLabel"], - type: "checkbox", - default: false - }, - { - id: "disableUrlList", - title: "disableUrlListLabel", - captions: ["disableUrlListCaptionLabel"], - type: "textarea", - default: "", - placeholder: "https://example.com/*\nhttps://example.net/*" + title: "disableTranslationLabel", + captions: [], + type: "none", + childElements: [ + { + id: "isDisabledInTextFields", + title: "isDisabledInTextFieldsLabel", + captions: ["isDisabledInTextFieldsCaptionLabel"], + type: "checkbox", + default: false + }, + { + id: "ignoredDocumentLang", + title: "ignoredDocumentLangLabel", + captions: ["ignoredDocumentLangCaptionLabel"], + type: "text", + default: "", + placeholder: "en, ru, zh", + new: true, + }, + { + id: "disableUrlList", + title: "disableUrlListLabel", + captions: ["disableUrlListCaptionLabel"], + type: "textarea", + default: "", + placeholder: "https://example.com/*\nhttps://example.net/*" + } + ] } ] },