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 33319 1275fb1bcae3
parent 33318 7edaf941a3be
child 33320 e01295953e4c
push id2368
push userclokep@gmail.com
push dateMon, 28 Jan 2019 21:12:50 +0000
treeherdercomm-beta@56d23c07d815 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
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"]