File mozilla-language.patch of Package MozillaFirefox.3830

# HG changeset patch
# User Wolfgang Rosenauer <wr@rosenauer.org>
# Parent f62fd77521e3fbfa2488392485bff8a7edb3801a
# Parent  73bc6f5ef7aaff0c54e951531025de5bb3985f22
Bug 583793 - Firefox interface language set to LANG, ignores LANGUAGE

diff --git a/intl/locale/nsLocaleService.cpp b/intl/locale/nsLocaleService.cpp
--- a/intl/locale/nsLocaleService.cpp
+++ b/intl/locale/nsLocaleService.cpp
@@ -123,16 +123,17 @@ nsLocaleService::nsLocaleService(void)
     RefPtr<nsLocale> resultLocale(new nsLocale());
     NS_ENSURE_TRUE_VOID(resultLocale);
 
 #ifdef MOZ_WIDGET_QT
     const char* lang = QLocale::system().name().toUtf8();
 #else
     // Get system configuration
     const char* lang = getenv("LANG");
+    const char* language = getenv("LANGUAGE");
 #endif
 
     nsAutoString xpLocale, platformLocale;
     nsAutoString category, category_platform;
     int i;
 
     for( i = 0; i < LocaleListLength; i++ ) {
         nsresult result;
@@ -159,16 +160,21 @@ nsLocaleService::nsLocaleService(void)
             } else {
                 CopyASCIItoUTF16(lang, platformLocale);
                 result = nsPosixLocale::GetXPLocale(lang, xpLocale);
             }
         }
         if (NS_FAILED(result)) {
             return;
         }
+        // LANGUAGE is overriding LC_MESSAGES
+        if (i == LC_MESSAGES && language && *language) {
+          CopyASCIItoUTF16(language, platformLocale);
+          result = nsPosixLocale::GetXPLocale(language, xpLocale);
+        }
         resultLocale->AddCategory(category, xpLocale);
         resultLocale->AddCategory(category_platform, platformLocale);
     }
     mSystemLocale = do_QueryInterface(resultLocale);
     mApplicationLocale = do_QueryInterface(resultLocale);
        
 #endif // XP_UNIX