Bug 1348259 - Switch nsLanguageAtomService to use OSPreferences::GetSystemLocale. r=m_kato draft
authorZibi Braniecki <gandalf@mozilla.com>
Tue, 21 Mar 2017 16:20:07 -0700
changeset 502694 7a62729ce4251c7cd046449c84f5072ed66cf7c9
parent 502579 8744e9f8eb99f1290aae81985812d57364f18708
child 550228 be4fcc71ba1b6513c4b1427b93f0370f12cc98cb
push id50359
push userzbraniecki@mozilla.com
push dateWed, 22 Mar 2017 07:08:31 +0000
reviewersm_kato
bugs1348259
milestone55.0a1
Bug 1348259 - Switch nsLanguageAtomService to use OSPreferences::GetSystemLocale. r=m_kato MozReview-Commit-ID: DvKbtrpfNJe
intl/locale/nsLanguageAtomService.cpp
--- a/intl/locale/nsLanguageAtomService.cpp
+++ b/intl/locale/nsLanguageAtomService.cpp
@@ -4,22 +4,22 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsLanguageAtomService.h"
 #include "nsUConvPropertySearch.h"
 #include "nsUnicharUtils.h"
 #include "nsIAtom.h"
 #include "mozilla/ArrayUtils.h"
 #include "mozilla/Services.h"
-#include "mozilla/intl/LocaleService.h"
+#include "mozilla/intl/OSPreferences.h"
 #include "nsServiceManagerUtils.h"
 #include "mozilla/dom/EncodingUtils.h"
 
 using namespace mozilla;
-using mozilla::intl::LocaleService;
+using mozilla::intl::OSPreferences;
 
 static constexpr nsUConvProp kLangGroups[] = {
 #include "langGroups.properties.h"
 };
 
 NS_IMPL_ISUPPORTS(nsLanguageAtomService, nsILanguageAtomService)
 
 nsLanguageAtomService::nsLanguageAtomService()
@@ -46,17 +46,17 @@ nsLanguageAtomService::LookupCharSet(con
 }
 
 nsIAtom*
 nsLanguageAtomService::GetLocaleLanguage()
 {
   do {
     if (!mLocaleLanguage) {
       nsAutoCString locale;
-      LocaleService::GetInstance()->GetAppLocaleAsLangTag(locale);
+      OSPreferences::GetInstance()->GetSystemLocale(locale);
 
       ToLowerCase(locale); // use lowercase for all language atoms
       mLocaleLanguage = NS_Atomize(locale);
     }
   } while (0);
 
   return mLocaleLanguage;
 }