From c780c12df760f6f747f1abcf25cc6382942f2914 Mon Sep 17 00:00:00 2001 From: Ken Powers Date: Wed, 25 Mar 2020 11:16:10 -0400 Subject: [PATCH] Use multiple spellCheckDirty messages --- _locales/en/messages.json | 10 +++++++--- js/views/settings_view.js | 8 +++++--- ts/util/lint/exceptions.json | 16 ++++++++-------- 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 53e0e9aca3..86826a473f 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -1088,9 +1088,13 @@ "message": "Enable spell check of text entered in message composition box", "description": "Description of the media permission description" }, - "spellCheckDirty": { - "message": "You must restart Signal to apply your new settings", - "description": "Shown when the user changes their spellcheck setting to indicate that they must restart Signal." + "spellCheckWillBeEnabled": { + "message": "Spell check will be enabled the next time Signal starts.", + "description": "Shown when the user enables spellcheck to indicate that they must restart Signal." + }, + "spellCheckWillBeDisabled": { + "message": "Spell check will be disabled the next time Signal starts.", + "description": "Shown when the user disables spellcheck to indicate that they must restart Signal." }, "clearDataHeader": { "message": "Clear Data", diff --git a/js/views/settings_view.js b/js/views/settings_view.js index 52055c0683..6ab373e597 100644 --- a/js/views/settings_view.js +++ b/js/views/settings_view.js @@ -141,9 +141,9 @@ 'click .clear-data': 'onClearData', }, render_attributes() { + const appStartSpellCheck = window.appStartInitialSpellcheckSetting; const spellCheckDirty = - window.initialData.spellCheck !== - window.appStartInitialSpellcheckSetting; + window.initialData.spellCheck !== appStartSpellCheck; return { deviceNameLabel: i18n('deviceName'), @@ -173,7 +173,9 @@ spellCheckDescription: i18n('spellCheckDescription'), spellCheckHidden: spellCheckDirty ? 'false' : 'true', spellCheckDisplay: spellCheckDirty ? 'inherit' : 'none', - spellCheckDirtyText: i18n('spellCheckDirty'), + spellCheckDirtyText: appStartSpellCheck + ? i18n('spellCheckWillBeDisabled') + : i18n('spellCheckWillBeEnabled'), }; }, onClose() { diff --git a/ts/util/lint/exceptions.json b/ts/util/lint/exceptions.json index e527408a6b..43c2b50196 100644 --- a/ts/util/lint/exceptions.json +++ b/ts/util/lint/exceptions.json @@ -928,36 +928,36 @@ "rule": "jQuery-$(", "path": "js/views/settings_view.js", "line": " this.$('.sync').text(i18n('syncNow'));", - "lineNumber": 198, + "lineNumber": 200, "reasonCategory": "usageTrusted", - "updated": "2020-03-20T19:55:50.800Z", + "updated": "2020-03-25T13:52:04.149Z", "reasonDetail": "Protected from arbitrary input" }, { "rule": "jQuery-$(", "path": "js/views/settings_view.js", "line": " this.$('.sync').attr('disabled', 'disabled');", - "lineNumber": 202, + "lineNumber": 204, "reasonCategory": "usageTrusted", - "updated": "2020-03-20T19:55:50.800Z", + "updated": "2020-03-25T13:52:04.149Z", "reasonDetail": "Protected from arbitrary input" }, { "rule": "jQuery-$(", "path": "js/views/settings_view.js", "line": " this.$('.synced_at').hide();", - "lineNumber": 214, + "lineNumber": 216, "reasonCategory": "usageTrusted", - "updated": "2020-03-20T19:55:50.800Z", + "updated": "2020-03-25T13:52:04.149Z", "reasonDetail": "Protected from arbitrary input" }, { "rule": "jQuery-$(", "path": "js/views/settings_view.js", "line": " this.$('.sync_failed').hide();", - "lineNumber": 219, + "lineNumber": 221, "reasonCategory": "usageTrusted", - "updated": "2020-03-20T19:55:50.800Z", + "updated": "2020-03-25T13:52:04.149Z", "reasonDetail": "Protected from arbitrary input" }, {