[tbb-commits] [tor-browser] 62/65: Bug 40309: Avoid using regional OS locales

gitolite role git at cupani.torproject.org
Thu Oct 20 14:34:00 UTC 2022


This is an automated email from the git hooks/post-receive script.

richard pushed a commit to branch geckoview-102.4.0esr-11.5-1
in repository tor-browser.

commit bfb6541bdea9c62ddcf3629c78e0c2072c7fcce6
Author: Alex Catarineu <acat at torproject.org>
AuthorDate: Wed Jan 27 11:28:05 2021 +0100

    Bug 40309: Avoid using regional OS locales
    
    Only use regional OS locales if the pref
    `intl.regional_prefs.use_os_locales` is set to true.
---
 intl/locale/LocaleService.cpp | 25 -------------------------
 1 file changed, 25 deletions(-)

diff --git a/intl/locale/LocaleService.cpp b/intl/locale/LocaleService.cpp
index 4ff18a1a90c4..974f02d85fc8 100644
--- a/intl/locale/LocaleService.cpp
+++ b/intl/locale/LocaleService.cpp
@@ -489,31 +489,6 @@ LocaleService::GetRegionalPrefsLocales(nsTArray<nsCString>& aRetVal) {
             OSPreferences::GetInstance()->GetRegionalPrefsLocales(aRetVal))) {
       return NS_OK;
     }
-
-    // If we fail to retrieve them, return the app locales.
-    GetAppLocalesAsBCP47(aRetVal);
-    return NS_OK;
-  }
-
-  // Otherwise, fetch OS Regional Preferences locales and compare the first one
-  // to the app locale. If the language subtag matches, we can safely use
-  // the OS Regional Preferences locale.
-  //
-  // This facilitates scenarios such as Firefox in "en-US" and User sets
-  // regional prefs to "en-GB".
-  nsAutoCString appLocale;
-  AutoTArray<nsCString, 10> regionalPrefsLocales;
-  LocaleService::GetInstance()->GetAppLocaleAsBCP47(appLocale);
-
-  if (NS_FAILED(OSPreferences::GetInstance()->GetRegionalPrefsLocales(
-          regionalPrefsLocales))) {
-    GetAppLocalesAsBCP47(aRetVal);
-    return NS_OK;
-  }
-
-  if (LocaleService::LanguagesMatch(appLocale, regionalPrefsLocales[0])) {
-    aRetVal = regionalPrefsLocales.Clone();
-    return NS_OK;
   }
 
   // Otherwise use the app locales.

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the tbb-commits mailing list