Bug 1348259 - Switch nsLanguageAtomService to use OSPreferences::GetSystemLocale. r=m_kato
MozReview-Commit-ID: DvKbtrpfNJe
--- 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;
}