Bug 1176671 - Change lang attribute when dictionary is changed; r=neil a=IanN for SeaMonkey 2.35 CLOSED TREE SEAMONKEY_2_35_RELEASE_BRANCH
authorJorg K <mozilla@jorgk.com>
Tue, 30 Jun 2015 10:52:33 -0700
branchSEAMONKEY_2_35_RELEASE_BRANCH
changeset 31180 02705c8c21864689c4911aa09982f48e9dd989ee
parent 31179 f45bcaa7cfb26ea5d747d9e817c21395dca15553
child 31181 9a67aa99cd2b19cb7b63107c92b49fceeb5c68c3
push id1
push userclokep@gmail.com
push dateMon, 07 May 2018 22:45:56 +0000
treeherdercomm-esr60@57eacde5ef40 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersneil, IanN
bugs1176671
Bug 1176671 - Change lang attribute when dictionary is changed; r=neil a=IanN for SeaMonkey 2.35 CLOSED TREE
editor/ui/dialogs/content/EdSpellCheck.js
--- a/editor/ui/dialogs/content/EdSpellCheck.js
+++ b/editor/ui/dialogs/content/EdSpellCheck.js
@@ -415,16 +415,21 @@ function EditDictionary()
   window.openDialog("chrome://editor/content/EdDictionary.xul", "_blank", "chrome,close,titlebar,modal", "", gMisspelledWord);
 }
 
 function SelectLanguage()
 {
   var item = gDialog.LanguageMenulist.selectedItem;
   if (item.value != "more-cmd") {
     gSpellChecker.SetCurrentDictionary(item.value);
+    // For compose windows we need to set the "lang" attribute so the
+    // core editor uses the correct dictionary for the inline spell check.
+    if (window.arguments[1]) {
+      window.opener.document.documentElement.setAttribute("lang", item.value);
+    }
     gLastSelectedLang = item;
   }
   else {
     openDictionaryList();
 
     if (gLastSelectedLang)
       gDialog.LanguageMenulist.selectedItem = gLastSelectedLang;
   }