Bug 1297520 - For Snap, only install language for system locale. r=nalexander
☠☠ backed out by 29fa47b9f641 ☠ ☠
authorMike Kaply <mozilla@kaply.com>
Wed, 06 Jul 2022 13:34:18 +0000
changeset 623142 94420b6eff4cb268d0cfa261caced76bdd7bff50
parent 623141 5f37ca2876e2865f75aaf2913a23f6a14dccf0d6
child 623143 7ed1a7a9d0fa448e5204f29aedef41792f4af0d3
push id165745
push usermozilla@kaply.com
push dateWed, 06 Jul 2022 13:38:23 +0000
treeherderautoland@94420b6eff4c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnalexander
bugs1297520
milestone104.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1297520 - For Snap, only install language for system locale. r=nalexander Differential Revision: https://phabricator.services.mozilla.com/D151052
intl/locale/LocaleService.cpp
--- a/intl/locale/LocaleService.cpp
+++ b/intl/locale/LocaleService.cpp
@@ -18,16 +18,19 @@
 #include "nsDirectoryServiceDefs.h"
 #include "nsIObserverService.h"
 #include "nsStringEnumerator.h"
 #include "nsXULAppAPI.h"
 #include "nsZipArchive.h"
 #ifdef XP_WIN
 #  include "WinUtils.h"
 #endif
+#ifdef MOZ_WIDGET_GTK
+#  include "mozilla/WidgetUtilsGtk.h"
+#endif
 
 #define INTL_SYSTEM_LOCALES_CHANGED "intl:system-locales-changed"
 
 #define PSEUDO_LOCALE_PREF "intl.l10n.pseudo"
 #define REQUESTED_LOCALES_PREF "intl.locale.requested"
 #define WEB_EXPOSED_LOCALES_PREF "intl.locale.privacy.web_exposed"
 
 static const char* kObservedPrefs[] = {REQUESTED_LOCALES_PREF,
@@ -64,16 +67,18 @@ static void SplitLocaleListStringIntoArr
 static void ReadRequestedLocales(nsTArray<nsCString>& aRetVal) {
   nsAutoCString str;
   nsresult rv = Preferences::GetCString(REQUESTED_LOCALES_PREF, str);
   // isRepack means this is a version of Firefox specifically
   // built for one language.
   const bool isRepack =
 #ifdef XP_WIN
       !mozilla::widget::WinUtils::HasPackageIdentity();
+#elif defined(MOZ_WIDGET_GTK)
+      !widget::IsRunningUnderSnap();
 #else
       true;
 #endif
 
   // We handle four scenarios here:
   //
   // 1) The pref is not set - use default locale
   // 2) The pref is not set and we're a packaged app - use OS locales