Bug 1519640 - Port bug 1509583: sorted dictionary list now uses localeCode/displayName instead of id/label. r=aceman
authorJorg K <jorgk@jorgk.com>
Sat, 12 Jan 2019 20:30:25 +0100
changeset 34173 1275fb1bcae3362c0d768131cb707a7963ab0618
parent 34172 7edaf941a3beca1b37c1797462456fe3cf92b6b4
child 34174 e01295953e4ce82a16768c70b49fb978d5049c35
push id389
push userclokep@gmail.com
push dateMon, 18 Mar 2019 19:01:53 +0000
reviewersaceman
bugs1519640, 1509583
Bug 1519640 - Port bug 1509583: sorted dictionary list now uses localeCode/displayName instead of id/label. r=aceman
editor/ui/dialogs/content/EdSpellCheck.js
mail/components/compose/content/MsgComposeCommands.js
mail/components/preferences/compose.js
--- a/editor/ui/dialogs/content/EdSpellCheck.js
+++ b/editor/ui/dialogs/content/EdSpellCheck.js
@@ -144,22 +144,22 @@ function InitLanguageMenu(aCurLang)
   while (languageMenuPopup.firstChild.localName != "menuseparator")
     languageMenuPopup.firstChild.remove();
 
   var defaultItem = null;
 
   for (var i = 0; i < count; i++)
   {
     let item = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "menuitem");
-    item.setAttribute("label", sortedList[i].label);
-    item.setAttribute("value", sortedList[i].id);
+    item.setAttribute("label", sortedList[i].displayName);
+    item.setAttribute("value", sortedList[i].localeCode);
     let beforeItem = gDialog.LanguageMenulist.getItemAtIndex(i);
     languageMenuPopup.insertBefore(item, beforeItem);
 
-    if (aCurLang && sortedList[i].id == aCurLang)
+    if (aCurLang && sortedList[i].localeCode == aCurLang)
       defaultItem = item;
   }
 
   // Now make sure the correct item in the menu list is selected.
   if (defaultItem)
   {
     gDialog.LanguageMenulist.selectedItem = defaultItem;
     gLastSelectedLang = defaultItem;
--- a/mail/components/compose/content/MsgComposeCommands.js
+++ b/mail/components/compose/content/MsgComposeCommands.js
@@ -3806,18 +3806,18 @@ function InitLanguageMenu() {
   var sortedList = gSpellChecker.sortDictionaryList(dictList);
 
   // Remove any languages from the list.
   while (languageMenuList.hasChildNodes())
     languageMenuList.lastChild.remove();
 
   for (let i = 0; i < count; i++) {
     var item = document.createElement("menuitem");
-    item.setAttribute("label", sortedList[i].label);
-    item.setAttribute("value", sortedList[i].id);
+    item.setAttribute("label", sortedList[i].displayName);
+    item.setAttribute("value", sortedList[i].localeCode);
     item.setAttribute("type", "radio");
     languageMenuList.appendChild(item);
   }
 }
 
 function OnShowDictionaryMenu(aTarget) {
   InitLanguageMenu();
   let curLang = document.documentElement.getAttribute("lang");
--- a/mail/components/preferences/compose.js
+++ b/mail/components/preferences/compose.js
@@ -168,17 +168,17 @@ var gComposePane = {
     var inlineSpellChecker = new InlineSpellChecker();
     var sortedList = inlineSpellChecker.sortDictionaryList(dictList);
 
     // Remove any languages from the list.
     languageMenuList.removeAllItems();
 
     // append the dictionaries to the menu list...
     for (var i = 0; i < count; i++)
-      languageMenuList.appendItem(sortedList[i].label, sortedList[i].id);
+      languageMenuList.appendItem(sortedList[i].displayName, sortedList[i].localeCode);
 
     languageMenuList.setInitialSelection();
   },
 
   populateFonts() {
     var fontsList = document.getElementById("FontSelect");
     try {
       var enumerator = Cc["@mozilla.org/gfx/fontenumerator;1"]