Bug 527173 - Spellchecker settings are in the Mail section but the SP is used by all components. r=IanN
authorEdmund Wong <ewong@pw-wspx.org>
Mon, 16 Jan 2012 06:03:00 +0100
changeset 10441 d7619adc645ff3326d688d9920c5993b9d71307b
parent 10440 986abadfbeb759e5de8f81397f67f90bb3c6471c
child 10442 f092cb0bd85c438ecf26c4e10dc6d088677f52e8
push idunknown
push userunknown
push dateunknown
reviewersIanN
bugs527173
Bug 527173 - Spellchecker settings are in the Mail section but the SP is used by all components. r=IanN
suite/common/jar.mn
suite/common/pref/pref-languages.xul
suite/common/pref/pref-spelling.js
suite/common/pref/pref-spelling.xul
suite/common/pref/preferences.xul
suite/locales/en-US/chrome/common/pref/pref-languages.dtd
suite/locales/en-US/chrome/common/pref/pref-spelling.dtd
suite/locales/en-US/chrome/common/pref/preferences.dtd
suite/locales/en-US/chrome/mailnews/pref/pref-composing_messages.dtd
suite/locales/jar.mn
suite/mailnews/compose/prefs/pref-composing_messages.js
suite/mailnews/compose/prefs/pref-composing_messages.xul
--- a/suite/common/jar.mn
+++ b/suite/common/jar.mn
@@ -216,16 +216,18 @@ comm.jar:
    content/communicator/pref/pref-scripts.js                        (pref/pref-scripts.js)
    content/communicator/pref/pref-scripts.xul                       (pref/pref-scripts.xul)
    content/communicator/pref/pref-search.js                         (pref/pref-search.js)
    content/communicator/pref/pref-search.xul                        (pref/pref-search.xul)
    content/communicator/pref/pref-security.js                       (pref/pref-security.js)
    content/communicator/pref/pref-security.xul                      (pref/pref-security.xul)
    content/communicator/pref/pref-smartupdate.js                    (pref/pref-smartupdate.js)
    content/communicator/pref/pref-smartupdate.xul                   (pref/pref-smartupdate.xul)
+   content/communicator/pref/pref-spelling.js                       (pref/pref-spelling.js)
+   content/communicator/pref/pref-spelling.xul                      (pref/pref-spelling.xul)
    content/communicator/pref/pref-sync.js                           (pref/pref-sync.js)
    content/communicator/pref/pref-sync.xul                          (pref/pref-sync.xul)
    content/communicator/pref/pref-tabs.xul                          (pref/pref-tabs.xul)
    content/communicator/profile/profileSelection.js                 (profile/profileSelection.js)
    content/communicator/profile/profileSelection.xul                (profile/profileSelection.xul)
    content/communicator/search/engineManager.js                     (search/engineManager.js)
    content/communicator/search/engineManager.xul                    (search/engineManager.xul)
    content/communicator/search/search.xml                           (search/search.xml)
--- a/suite/common/pref/pref-languages.xul
+++ b/suite/common/pref/pref-languages.xul
@@ -60,19 +60,16 @@
                   name="pref.browser.language.disable_button.add"
                   type="bool"/>
       <preference id="pref.browser.language.disable_button.remove"
                   name="pref.browser.language.disable_button.remove"
                   type="bool"/>
       <preference id="intl.charset.default"
                   name="intl.charset.default"
                   type="wstring"/>
-      <preference id="layout.spellcheckDefault"
-                  name="layout.spellcheckDefault"
-                  type="int"/>
     </preferences>
 
     <stringbundle id="acceptedBundle"
                   src="resource://gre/res/language.properties"/>
     <stringbundle id="languagesBundle"
                   src="chrome://global/locale/languageNames.properties"/>
     <stringbundle id="regionsBundle"
                   src="chrome://global/locale/regionNames.properties"/>
@@ -141,26 +138,10 @@
                         value="..."
                         uri="..."/>
             </menupopup>
           </template>
         </menulist> 
       </hbox>
     </groupbox>
 
-    <groupbox align="start">
-      <caption label="&spelling.label;"/>
-      <hbox align="center">
-        <label value="&checkSpelling.label;"
-               accesskey="&checkSpelling.accesskey;"
-               control="spellcheckDefault"/>
-        <menulist id="spellcheckDefault"
-                  preference="layout.spellcheckDefault">
-          <menupopup>
-            <menuitem value="0" label="&dontCheckSpelling.label;"/>
-            <menuitem value="1" label="&multilineCheckSpelling.label;"/>
-            <menuitem value="2" label="&alwaysCheckSpelling.label;"/>
-          </menupopup>
-        </menulist>
-      </hbox>
-    </groupbox>
   </prefpane>
 </overlay>
new file mode 100644
--- /dev/null
+++ b/suite/common/pref/pref-spelling.js
@@ -0,0 +1,119 @@
+/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+var gDictCount = 0;
+var gLastSelectedLang;
+
+function Startup() {
+  if ("@mozilla.org/spellchecker;1" in Components.classes)
+    InitLanguageMenu();
+  else
+  {
+    document.getElementById("generalSpelling").hidden = true;
+    document.getElementById("mailSpelling").hidden = true;
+    document.getElementById("noSpellCheckLabel").hidden = false;
+  }
+}
+
+function InitLanguageMenu() {
+  var spellChecker = Components.classes["@mozilla.org/spellchecker/engine;1"]
+                               .getService(Components.interfaces.mozISpellCheckingEngine);
+
+  var o1 = {};
+  var o2 = {};
+
+  // Get the list of dictionaries from the spellchecker.
+  spellChecker.getDictionaryList(o1, o2);
+
+  var dictList = o1.value;
+  var count    = o2.value;
+
+  // If dictionary count hasn't changed then no need to update the menu.
+  if (gDictCount == count)
+    return;
+
+  // Store current dictionary count.
+  gDictCount = count;
+
+  // Load the string bundles that will help us map
+  // RFC 1766 strings to UI strings.
+
+  // Load the language string bundle.
+  var languageBundle = document.getElementById("languageBundle");
+  var regionBundle = null;
+  // If we have a language string bundle, load the region string bundle.
+  if (languageBundle)
+    regionBundle = document.getElementById("regionBundle");
+  
+  var menuStr2;
+  var isoStrArray;
+  var langId;
+  var langLabel;
+
+  for (let i = 0; i < count; i++) {
+    try {
+      langId = dictList[i];
+      isoStrArray = dictList[i].split(/[-_]/);
+
+      if (languageBundle && isoStrArray[0])
+        langLabel = languageBundle.getString(isoStrArray[0].toLowerCase());
+
+      if (regionBundle && langLabel && isoStrArray.length > 1 && isoStrArray[1]) {
+        menuStr2 = regionBundle.getString(isoStrArray[1].toLowerCase());
+        if (menuStr2)
+          langLabel += "/" + menuStr2;
+      }
+
+      if (langLabel && isoStrArray.length > 2 && isoStrArray[2])
+        langLabel += " (" + isoStrArray[2] + ")";
+
+      if (!langLabel)
+        langLabel = langId;
+    } catch (ex) {
+      // getString throws an exception when a key is not found in the
+      // bundle. In that case, just use the original dictList string.
+      langLabel = langId;
+    }
+    dictList[i] = [langLabel, langId];
+  }
+  
+  // sort by locale-aware collation
+  dictList.sort(
+    function compareFn(a, b) {
+      return a[0].localeCompare(b[0]);
+    }
+  );
+
+  var languageMenuList = document.getElementById("languageMenuList");
+  // Remove any languages from the list.
+  var languageMenuPopup = languageMenuList.firstChild;
+  while (languageMenuPopup.firstChild.localName != "menuseparator")
+    languageMenuPopup.removeChild(languageMenuPopup.firstChild);
+
+  var curLang  = languageMenuList.value;
+  var defaultItem = null;
+
+  for (let i = 0; i < count; i++) {
+    let item = languageMenuList.insertItemAt(i, dictList[i][0], dictList[i][1]);
+    if (curLang && dictList[i][1] == curLang)
+      defaultItem = item;
+  }
+
+  // Now make sure the correct item in the menu list is selected.
+  if (defaultItem) {
+    languageMenuList.selectedItem = defaultItem;
+    gLastSelectedLang = defaultItem;
+  }
+}
+
+function SelectLanguage(aTarget) {
+  if (aTarget.value != "more-cmd")
+    gLastSelectedLang = aTarget;
+  else {
+    openDictionaryList();
+    if (gLastSelectedLang)
+      document.getElementById("languageMenuList").selectedItem = gLastSelectedLang;
+  }
+}
new file mode 100644
--- /dev/null
+++ b/suite/common/pref/pref-spelling.xul
@@ -0,0 +1,85 @@
+<?xml version="1.0"?>
+
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+   - License, v. 2.0. If a copy of the MPL was not distributed with this file,
+   - You can obtain one at http://mozilla.org/MPL/2.0/.  -->
+
+<!DOCTYPE overlay SYSTEM "chrome://communicator/locale/pref/pref-spelling.dtd">
+
+<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+  <prefpane id="spelling_pane"
+            label="&prefSpelling.title;"
+            script="chrome://communicator/content/pref/pref-spelling.js">
+
+    <stringbundle id="languageBundle"
+                  src="chrome://global/locale/languageNames.properties"/>
+    <stringbundle id="regionBundle"
+                  src="chrome://global/locale/regionNames.properties"/>
+
+    <preferences id="spelling_preferences">
+      <preference id="mail.SpellCheckBeforeSend"
+                  name="mail.SpellCheckBeforeSend"
+                  type="bool"/>
+      <preference id="mail.spellcheck.inline"
+                  name="mail.spellcheck.inline"
+                  type="bool"/>
+      <preference id="spellchecker.dictionary"
+                  name="spellchecker.dictionary"
+                  type="string"
+                  onchange="SelectLanguage(event.target)"/>
+      <preference id="layout.spellcheckDefault"
+                  name="layout.spellcheckDefault"
+                  type="int"/>
+    </preferences>
+
+    <label id="noSpellCheckLabel"
+           value="&noSpellCheckAvailable.label;"
+           hidden="true"/>
+
+    <groupbox id="generalSpelling" align="start">
+      <caption label="&generalSpelling.label;"/>
+      <hbox align="center" pack="start">
+        <label value="&languagePopup.label;"
+               accesskey="&languagePopup.accessKey;"
+               control="languageMenuList"/>
+        <menulist id="languageMenuList"
+                  preference="spellchecker.dictionary">
+          <menupopup onpopupshowing="InitLanguageMenu();">
+            <!-- dynamic content populated by JS -->
+            <menuseparator/>
+            <menuitem value="more-cmd" label="&moreDictionaries.label;"/>
+          </menupopup>
+        </menulist>
+        <spring flex="1"/>
+      </hbox>
+      <separator class="thin"/>
+      <hbox align="center">
+        <label value="&checkSpellingWhenTyping.label;"
+               accesskey="&checkSpellingWhenTyping.accesskey;"
+               control="spellcheckDefault"/>
+        <menulist id="spellcheckDefault"
+                  preference="layout.spellcheckDefault">
+          <menupopup>
+            <menuitem value="0" label="&dontCheckSpelling.label;"/>
+            <menuitem value="1" label="&multilineCheckSpelling.label;"/>
+            <menuitem value="2" label="&alwaysCheckSpelling.label;"/>
+          </menupopup>
+        </menulist>
+      </hbox>
+    </groupbox>
+
+    <groupbox id="mailSpelling" align="start">
+      <caption label="&spellForMailAndNews.label;"/>
+      <vbox align="start">
+        <checkbox id="spellCheckBeforeSend"
+                  label="&checkSpellingBeforeSend.label;"
+                  accesskey="&checkSpellingBeforeSend.accesskey;"
+                  preference="mail.SpellCheckBeforeSend"/>
+        <checkbox id="inlineSpellCheck"
+                  label="&spellCheckInline.label;"
+                  accesskey="&spellCheckInline.accesskey;"
+                  preference="mail.spellcheck.inline"/>
+      </vbox>
+     </groupbox>
+  </prefpane>
+</overlay>
--- a/suite/common/pref/preferences.xul
+++ b/suite/common/pref/preferences.xul
@@ -95,16 +95,21 @@
                     prefpane="fonts_pane"
                     helpTopic="appearance_pref_fonts"
                     url="chrome://communicator/content/pref/pref-fonts.xul"/>
           <treeitem id="colorsItem"
                     label="&colors.label;"
                     prefpane="colors_pane"
                     helpTopic="appearance_pref_colors"
                     url="chrome://communicator/content/pref/pref-colors.xul"/>
+          <treeitem id="spellingItem"
+                    label="&spellingPane.label;"
+                    prefpane="spelling_pane"
+                    helpTopic="appearance_pref_spelling"
+                    url="chrome://communicator/content/pref/pref-spelling.xul"/>
         </treechildren>
       </treeitem>
 
       <!-- Browser items -->
       <treeitem container="true"
                 id="navigatorItem"
                 label="&navigator.label;"
                 prefpane="navigator_pane"
--- a/suite/locales/en-US/chrome/common/pref/pref-languages.dtd
+++ b/suite/locales/en-US/chrome/common/pref/pref-languages.dtd
@@ -18,15 +18,8 @@
 <!ENTITY languages.customize.DefaultCharset.label       "Character Encoding:">
 <!ENTITY languages.customize.DefaultCharset.accesskey   "C">
 <!-- LOCALIZATION NOTE  Character Encoding Preferences Dialog: Do NOT localize the terms "en-bz, ar-jo"  -->
 <!ENTITY languages.customize.others.examples            "e.g.: en-bz, ar-jo">
 <!ENTITY languages.customize.moveUp.label               "Move Up">
 <!ENTITY languages.customize.moveUp.accesskey           "U">
 <!ENTITY languages.customize.moveDown.label             "Move Down">
 <!ENTITY languages.customize.moveDown.accesskey         "D">
-
-<!ENTITY spelling.label                                 "Spelling">
-<!ENTITY checkSpelling.label                            "When typing check my spelling:">
-<!ENTITY checkSpelling.accesskey                        "W">
-<!ENTITY dontCheckSpelling.label                        "Never">
-<!ENTITY multilineCheckSpelling.label                   "In multiline boxes">
-<!ENTITY alwaysCheckSpelling.label                      "All boxes">
new file mode 100644
--- /dev/null
+++ b/suite/locales/en-US/chrome/common/pref/pref-spelling.dtd
@@ -0,0 +1,20 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+   - License, v. 2.0. If a copy of the MPL was not distributed with this file,
+   - You can obtain one at http://mozilla.org/MPL/2.0/.  -->
+   
+<!ENTITY prefSpelling.title                   "Spelling">
+<!ENTITY generalSpelling.label                "General">
+<!ENTITY checkSpellingWhenTyping.label        "When typing, check my spelling:">
+<!ENTITY checkSpellingWhenTyping.accesskey    "W">
+<!ENTITY dontCheckSpelling.label              "Never">
+<!ENTITY multilineCheckSpelling.label         "In multiline boxes">
+<!ENTITY alwaysCheckSpelling.label            "All boxes">
+<!ENTITY spellForMailAndNews.label            "Mail &amp; Newsgroups">
+<!ENTITY checkSpellingBeforeSend.label        "Check spelling before sending">
+<!ENTITY checkSpellingBeforeSend.accesskey    "C">
+<!ENTITY spellCheckInline.label               "Check spelling as you type">
+<!ENTITY spellCheckInline.accesskey           "e">
+<!ENTITY languagePopup.label                  "Language:">
+<!ENTITY languagePopup.accessKey              "L">
+<!ENTITY moreDictionaries.label               "Download more dictionaries&#x2026;">
+<!ENTITY noSpellCheckAvailable.label          "No dictionaries available.">
--- a/suite/locales/en-US/chrome/common/pref/preferences.dtd
+++ b/suite/locales/en-US/chrome/common/pref/preferences.dtd
@@ -31,10 +31,11 @@
 <!ENTITY smart.label "Software Installation">
 <!ENTITY download.label "Downloads">
 <!ENTITY keynav.label "Keyboard Navigation">
 <!ENTITY findAsYouType.label "Find As You Type">
 <!ENTITY search.label "Internet Search">
 <!ENTITY policies.label "Security Policies">
 <!ENTITY mousewheel.label "Mouse Wheel">
 <!ENTITY scriptsAndWindows.label "Scripts &amp; Plugins">
+<!ENTITY spellingPane.label  "Spelling">
 
 <!ENTITY focusSearch.key "f">
--- a/suite/locales/en-US/chrome/mailnews/pref/pref-composing_messages.dtd
+++ b/suite/locales/en-US/chrome/mailnews/pref/pref-composing_messages.dtd
@@ -53,25 +53,16 @@
 <!ENTITY autoSave.label                       "Automatically save the message every">
 <!ENTITY autoSave.accesskey                   "u">
 <!ENTITY autoSaveEnd.label                    "minutes">
 <!-- LOCALIZATION NOTE (wrapOutMsg.label): This will concatenate with "xxx characters", using a number and (char.label). -->
 <!ENTITY wrapOutMsg.label                     "Wrap plain text messages at">
 <!ENTITY wrapOutMsg.accesskey                 "W">
 <!ENTITY char.label                           "characters">
 
-<!ENTITY spellingHeader.label                 "Spelling">
-<!ENTITY spellCheck.label                     "Check spelling before sending">
-<!ENTITY spellCheck.accesskey                 "C">
-<!ENTITY spellCheckInline.label               "Check spelling as you type">
-<!ENTITY spellCheckInline.accesskey           "e">
-<!ENTITY languagePopup.label                  "Language:">
-<!ENTITY languagePopup.accessKey              "g">
-<!ENTITY moreDictionaries.label               "Download more dictionaries…">
-
 <!ENTITY defaultMessagesHeader.label          "Defaults for HTML Messages">
 <!ENTITY font.label                           "Font:">
 <!ENTITY font.accesskey                       "F">
 <!ENTITY size.label                           "Size:">
 <!ENTITY size.accesskey                       "S">
 <!ENTITY fontColor.label                      "Text:">
 <!ENTITY fontColor.accesskey                  "T">
 <!ENTITY bgColor.label                        "Background:">
--- a/suite/locales/jar.mn
+++ b/suite/locales/jar.mn
@@ -176,16 +176,17 @@
   locale/@AB_CD@/communicator/pref/pref-policies.dtd                        (%chrome/common/pref/pref-policies.dtd)
   locale/@AB_CD@/communicator/pref/pref-popups.dtd                          (%chrome/common/pref/pref-popups.dtd)
   locale/@AB_CD@/communicator/pref/pref-proxies.dtd                         (%chrome/common/pref/pref-proxies.dtd)
   locale/@AB_CD@/communicator/pref/pref-proxies-advanced.dtd                (%chrome/common/pref/pref-proxies-advanced.dtd)
   locale/@AB_CD@/communicator/pref/pref-scripts.dtd                         (%chrome/common/pref/pref-scripts.dtd)
   locale/@AB_CD@/communicator/pref/pref-search.dtd                          (%chrome/common/pref/pref-search.dtd)
   locale/@AB_CD@/communicator/pref/pref-security.dtd                        (%chrome/common/pref/pref-security.dtd)
   locale/@AB_CD@/communicator/pref/pref-smartupdate.dtd                     (%chrome/common/pref/pref-smartupdate.dtd)
+  locale/@AB_CD@/communicator/pref/pref-spelling.dtd                        (%chrome/common/pref/pref-spelling.dtd)
   locale/@AB_CD@/communicator/pref/pref-sync.dtd                            (%chrome/common/pref/pref-sync.dtd)
   locale/@AB_CD@/communicator/pref/pref-tabs.dtd                            (%chrome/common/pref/pref-tabs.dtd)
   locale/@AB_CD@/communicator-platform/mac/pref/platformPrefOverlay.dtd     (%chrome/common/pref/mac/platformPrefOverlay.dtd)
   locale/@AB_CD@/communicator-platform/unix/pref/platformPrefOverlay.dtd    (%chrome/common/pref/unix/platformPrefOverlay.dtd)
   locale/@AB_CD@/communicator-platform/win/pref/platformPrefOverlay.dtd     (%chrome/common/pref/win/platformPrefOverlay.dtd)
   locale/@AB_CD@/communicator/profile/profileSelection.dtd                  (%chrome/common/profile/profileSelection.dtd)
   locale/@AB_CD@/communicator/profile/profileSelection.properties           (%chrome/common/profile/profileSelection.properties)
   locale/@AB_CD@/communicator/safeMode.dtd                                  (%chrome/common/safeMode.dtd)
--- a/suite/mailnews/compose/prefs/pref-composing_messages.js
+++ b/suite/mailnews/compose/prefs/pref-composing_messages.js
@@ -31,25 +31,17 @@
  * use your version of this file under the terms of the MPL, indicate your
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
-var gLastSelectedLang;
-var gDictCount = 0;
-
 function Startup() {
-  if ("@mozilla.org/spellchecker;1" in Components.classes)
-    InitLanguageMenu();
-  else
-    document.getElementById("spellingGroup").hidden = true;
-
   let value = document.getElementById("mail.compose.autosave").value;
   EnableElementById("autoSaveInterval", value, false);
 }
 
 function EnableMailComposeAutosaveInterval(aValue) {
   let focus = (document.getElementById("autoSave") == document.commandDispatcher.focusedElement);
   EnableElementById("autoSaveInterval", aValue, focus);
 }
@@ -63,110 +55,8 @@ function PopulateFonts() {
     var localFonts = enumerator.EnumerateAllFonts(localFontCount);
     for (var i = 0; i < localFonts.length; ++i) {
       if (localFonts[i] != "") {
         fontsList.appendItem(localFonts[i], localFonts[i]);
       }
     }
   } catch (ex) { }
 }
-
-function InitLanguageMenu() {
-  var spellChecker = Components.classes["@mozilla.org/spellchecker/engine;1"]
-                               .getService(Components.interfaces.mozISpellCheckingEngine);
-
-  var o1 = {};
-  var o2 = {};
-
-  // Get the list of dictionaries from the spellchecker.
-  spellChecker.getDictionaryList(o1, o2);
-
-  var dictList = o1.value;
-  var count    = o2.value;
-
-  // If dictionary count hasn't changed then no need to update the menu.
-  if (gDictCount == count)
-    return;
-
-  // Store current dictionary count.
-  gDictCount = count;
-
-  // Load the string bundles that will help us map
-  // RFC 1766 strings to UI strings.
-
-  // Load the language string bundle.
-  var languageBundle = document.getElementById("languageBundle");
-  var regionBundle = null;
-  // If we have a language string bundle, load the region string bundle.
-  if (languageBundle)
-    regionBundle = document.getElementById("regionBundle");
-  
-  var menuStr2;
-  var isoStrArray;
-  var langId;
-  var langLabel;
-  var i;
-
-  for (i = 0; i < count; i++) {
-    try {
-      langId = dictList[i];
-      isoStrArray = dictList[i].split(/[-_]/);
-
-      if (languageBundle && isoStrArray[0])
-        langLabel = languageBundle.getString(isoStrArray[0].toLowerCase());
-
-      if (regionBundle && langLabel && isoStrArray.length > 1 && isoStrArray[1]) {
-        menuStr2 = regionBundle.getString(isoStrArray[1].toLowerCase());
-        if (menuStr2)
-          langLabel += "/" + menuStr2;
-      }
-
-      if (langLabel && isoStrArray.length > 2 && isoStrArray[2])
-        langLabel += " (" + isoStrArray[2] + ")";
-
-      if (!langLabel)
-        langLabel = langId;
-    } catch (ex) {
-      // getString throws an exception when a key is not found in the
-      // bundle. In that case, just use the original dictList string.
-      langLabel = langId;
-    }
-    dictList[i] = [langLabel, langId];
-  }
-  
-  // sort by locale-aware collation
-  dictList.sort(
-    function compareFn(a, b) {
-      return a[0].localeCompare(b[0]);
-    }
-  );
-
-  var languageMenuList = document.getElementById("languageMenuList");
-  // Remove any languages from the list.
-  var languageMenuPopup = languageMenuList.firstChild;
-  while (languageMenuPopup.firstChild.localName != "menuseparator")
-    languageMenuPopup.removeChild(languageMenuPopup.firstChild);
-
-  var curLang  = languageMenuList.value;
-  var defaultItem = null;
-
-  for (i = 0; i < count; i++) {
-    var item = languageMenuList.insertItemAt(i, dictList[i][0], dictList[i][1]);
-    if (curLang && dictList[i][1] == curLang)
-      defaultItem = item;
-  }
-
-  // Now make sure the correct item in the menu list is selected.
-  if (defaultItem) {
-    languageMenuList.selectedItem = defaultItem;
-    gLastSelectedLang = defaultItem;
-  }
-}
-
-function SelectLanguage(aTarget) {
-  if (aTarget.value != "more-cmd")
-    gLastSelectedLang = aTarget;
-  else {
-    openDictionaryList();
-    if (gLastSelectedLang)
-      document.getElementById("languageMenuList").selectedItem = gLastSelectedLang;
-  }
-}
--- a/suite/mailnews/compose/prefs/pref-composing_messages.xul
+++ b/suite/mailnews/compose/prefs/pref-composing_messages.xul
@@ -70,26 +70,16 @@
                   name="mail.compose.autosaveinterval"
                   type="int"/>
       <preference id="mail.warn_on_send_accel_key"
                   name="mail.warn_on_send_accel_key"
                   type="bool"/>
       <preference id="mailnews.wraplength"
                   name="mailnews.wraplength"
                   type="int"/>
-      <preference id="mail.SpellCheckBeforeSend"
-                  name="mail.SpellCheckBeforeSend"
-                  type="bool"/>
-      <preference id="mail.spellcheck.inline"
-                  name="mail.spellcheck.inline"
-                  type="bool"/>
-      <preference id="spellchecker.dictionary"
-                  name="spellchecker.dictionary"
-                  type="string"
-                  onchange="SelectLanguage(event.target)"/>
       <preference id="msgcompose.font_face"
                   name="msgcompose.font_face"
                   type="string"/>
       <preference id="msgcompose.font_size"
                   name="msgcompose.font_size"
                   type="string"/>
       <preference id="msgcompose.text_color"
                   name="msgcompose.text_color"
@@ -151,46 +141,16 @@
                  size="3"
                  preference="mailnews.wraplength"
                  aria-labelledby="wrapOutLabel wrapLength wrapOutEnd"/>
         <label id="wrapOutEnd" value="&char.label;"/>
       </hbox>
     </groupbox>
   
     <!-- Composing Mail -->
-    <groupbox id="spellingGroup" align="start">
-      <caption label="&spellingHeader.label;"/>
-      <vbox align="start">
-        <checkbox id="spellCheckBeforeSend"
-                  label="&spellCheck.label;"
-                  accesskey="&spellCheck.accesskey;"
-                  preference="mail.SpellCheckBeforeSend"/>
-        <checkbox id="inlineSpellCheck"
-                  label="&spellCheckInline.label;"
-                  accesskey="&spellCheckInline.accesskey;"
-                  preference="mail.spellcheck.inline"/>
-      </vbox>
-  
-      <separator class="thin"/>
-  
-      <hbox align="center" pack="start">
-        <label value="&languagePopup.label;"
-               accesskey="&languagePopup.accessKey;"
-               control="languageMenuList"/>
-        <menulist id="languageMenuList"
-                  preference="spellchecker.dictionary">
-          <menupopup onpopupshowing="InitLanguageMenu();">
-            <!-- dynamic content populated by JS -->
-            <menuseparator/>
-            <menuitem value="more-cmd" label="&moreDictionaries.label;"/>
-          </menupopup>
-        </menulist>
-        <spring flex="1"/>
-      </hbox>
-    </groupbox>
  
     <groupbox align="start">
       <caption label="&defaultMessagesHeader.label;"/>
       <grid>
         <columns>
           <column/>
           <column/>
         </columns>