LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File mozilla-ua-locale.patch of Package seamonkey.368 (Project openSUSE:11.4:Update)

From: upstream
Subject: allow reading general.useragent.locale from user profile
References:
https://bugzilla.mozilla.org/show_bug.cgi?id=542999
http://bugzilla.novell.com/show_bug.cgi?id=582654

diff --git a/chrome/src/nsChromeRegistryChrome.cpp b/chrome/src/nsChromeRegistryChrome.cpp
--- a/chrome/src/nsChromeRegistryChrome.cpp
+++ b/chrome/src/nsChromeRegistryChrome.cpp
@@ -318,20 +318,21 @@ nsChromeRegistryChrome::GetSelectedLocal
 
   return NS_OK;
 }
 
 nsresult
 nsChromeRegistryChrome::SelectLocaleFromPref(nsIPrefBranch* prefs)
 {
   nsresult rv;
-  bool matchOSLocale = false;
+  bool matchOSLocale = false, userLocaleOverride = false;
+  prefs->PrefHasUserValue(SELECTED_LOCALE_PREF, &userLocaleOverride);
   rv = prefs->GetBoolPref(MATCH_OS_LOCALE_PREF, &matchOSLocale);
 
-  if (NS_SUCCEEDED(rv) && matchOSLocale) {
+  if (NS_SUCCEEDED(rv) && matchOSLocale && !userLocaleOverride) {
     // compute lang and region code only when needed!
     nsCAutoString uiLocale;
     rv = getUILangCountry(uiLocale);
     if (NS_SUCCEEDED(rv))
       mSelectedLocale = uiLocale;
   }
   else {
     nsXPIDLCString provider;