Bug 1597540 - Provide default spellchecker.dictionary for suite. r=IanN
authorFrank-Rainer Grahl <frgrahl@gmx.net>
Tue, 19 Nov 2019 11:46:55 +0100
changeset 37561 64188fcfd0e255b5b0d4eb6735fd00e86a798186
parent 37560 54cb02ce13e7e6ab73b7c2b4ee47c024e9a1dc3c
child 37562 7d9bc05f93c767c9c20716fbca2fa8338875fe3c
push id396
push userclokep@gmail.com
push dateMon, 06 Jan 2020 23:11:57 +0000
reviewersIanN
bugs1597540
Bug 1597540 - Provide default spellchecker.dictionary for suite. r=IanN 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
@@ -361,16 +361,17 @@ pref("mail.biff.show_new_alert",     tru
 
 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
@@ -1142,23 +1142,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"]