Bug 1610109 - Port bug 1609585 - Migrate all possible uses from AppLocalesAsLangTag(s) to AppLocale(s)AsBCP47. r=mkmelin DONTBUILD
authorRichard Marti <richard.marti@gmail.com>
Sun, 19 Jan 2020 12:14:44 +0200
changeset 37979 8408774e360fe8b68ae4010fdcdb64e6e5192faf
parent 37978 bbea4c75d9828dcde30f383a50096381e33c83a6
child 37980 aa09b869e1e5ac06a4a8d70e72d3d2d54fd4b44b
push id398
push userclokep@gmail.com
push dateMon, 09 Mar 2020 19:10:28 +0000
reviewersmkmelin
bugs1610109, 1609585
Bug 1610109 - Port bug 1609585 - Migrate all possible uses from AppLocalesAsLangTag(s) to AppLocale(s)AsBCP47. r=mkmelin DONTBUILD
mail/components/customizableui/content/panelUI.js
mailnews/base/util/nsMsgDBFolder.cpp
--- a/mail/components/customizableui/content/panelUI.js
+++ b/mail/components/customizableui/content/panelUI.js
@@ -1322,17 +1322,17 @@ const PanelUI = {
 
 XPCOMUtils.defineConstant(this, "PanelUI", PanelUI);
 
 /**
  * Gets the currently selected locale for display.
  * @return  the selected locale
  */
 function getLocale() {
-  return Services.locale.appLocaleAsLangTag;
+  return Services.locale.appLocaleAsBCP47;
 }
 
 /**
  * Given a DOM node inside a <popupnotification>, return the parent <popupnotification>.
  */
 function getNotificationFromElement(aElement) {
   return aElement.closest("popupnotification");
 }
--- a/mailnews/base/util/nsMsgDBFolder.cpp
+++ b/mailnews/base/util/nsMsgDBFolder.cpp
@@ -3111,17 +3111,17 @@ NS_IMETHODIMP nsMsgDBFolder::GetPrettyNa
 }
 
 // -1: not retrieved yet, 1: English, 0: non-English.
 static int isEnglish = -1;
 
 static bool nonEnglishApp() {
   if (isEnglish == -1) {
     nsAutoCString locale;
-    mozilla::intl::LocaleService::GetInstance()->GetAppLocaleAsLangTag(locale);
+    mozilla::intl::LocaleService::GetInstance()->GetAppLocaleAsBCP47(locale);
     isEnglish = (locale.EqualsLiteral("en") ||
                  StringBeginsWith(locale, NS_LITERAL_CSTRING("en-")))
                     ? 1
                     : 0;
   }
   return isEnglish ? false : true;
 }