Bug 1597540 - Provide default spellchecker.dictionary for suite. r=IanN a=IanN CLOSED TREE
authorFrank-Rainer Grahl <frgrahl@gmx.net>
Tue, 19 Nov 2019 17:50:29 +0100
changeset 32376 9c0bd42275f46ca508ef3a3f43869e3e0b0c432e
parent 32375 6eb03b94327b2bbc1fc131ed7721d6b6d3d2d8a2
child 32377 232db96d678a8360116d6f2d2f956432ea6a9ab7
push id230
push userfrgrahl@gmx.net
push dateTue, 19 Nov 2019 16:51:10 +0000
treeherdercomm-esr60@232db96d678a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersIanN, IanN
bugs1597540
Bug 1597540 - Provide default spellchecker.dictionary for suite. r=IanN a=IanN CLOSED TREE l10n builds might not provide this in suite-l10n.js and composing messages will fail then.
suite/app/profile/suite-prefs.js
suite/components/nsSuiteGlue.js
--- a/suite/app/profile/suite-prefs.js
+++ b/suite/app/profile/suite-prefs.js
@@ -364,16 +364,17 @@ pref("mail.calendar-integration.opt-out"
 
 pref("mailnews.ui.deleteMarksRead", true);
 
 // The maximum amount of decoded image data we'll willingly keep around (we
 // might keep around more than this, but we'll try to get down to this value).
 // (This is intentionally on the high side; see bugs 746055 and 768015.)
 pref("image.mem.max_decoded_image_kb", 256000);
 
+pref("spellchecker.dictionary", "");
 pref("spellchecker.dictionaries.download.url", "https://addons.thunderbird.net/%LOCALE%/%APP%/dictionaries");
 
 // this will automatically enable inline spellchecking (if it is available) for
 // editable elements in HTML
 // 0 = spellcheck nothing
 // 1 = check multi-line controls [default]
 // 2 = check multi/single line controls
 pref("layout.spellcheckDefault", 1);
--- a/suite/components/nsSuiteGlue.js
+++ b/suite/components/nsSuiteGlue.js
@@ -1141,23 +1141,19 @@ SuiteGlue.prototype = {
     // tri-state; 0=always but not accessibility themes, 1=always, 2=never
     try {
       if (!Services.prefs.getBoolPref("browser.display.use_document_colors")) {
         Services.prefs.setIntPref("browser.display.document_color_use", 2);
         Services.prefs.clearUserPref("browser.display.use_document_colors");
       }
     } catch (ex) {}
 
-    // try to get dictionary preference and initialize with blank if not set
+    // Try to get dictionary preference and adjust if not valid.
     var prefName = "spellchecker.dictionary";
-    var prefValue = "";
-
-    try {
-      prefValue = Services.prefs.getCharPref(prefName);
-    } catch (ex) {}
+    var prefValue = Services.prefs.getCharPref(prefName);
 
     // replace underscore with dash if found in language
     if (/_/.test(prefValue)) {
       prefValue = prefValue.replace(/_/g, "-");
       Services.prefs.setCharPref(prefName, prefValue);
     }
 
     var spellChecker = Cc["@mozilla.org/spellchecker/engine;1"]