2011-06-28 20:42:13 +02:00
|
|
|
# HG changeset patch
|
|
|
|
# User Wolfgang Rosenauer <wr@rosenauer.org>
|
2015-06-21 13:26:59 +02:00
|
|
|
# Parent 5a29924228527f8882c83cf62d470963ea1ce62e
|
2011-06-28 20:42:13 +02:00
|
|
|
Bug 583793 - Firefox interface language set to LANG, ignores LANGUAGE
|
|
|
|
|
2015-06-21 13:26:59 +02:00
|
|
|
diff --git a/intl/locale/nsLocaleService.cpp b/intl/locale/nsLocaleService.cpp
|
|
|
|
--- a/intl/locale/nsLocaleService.cpp
|
|
|
|
+++ b/intl/locale/nsLocaleService.cpp
|
2014-07-28 15:29:31 +02:00
|
|
|
@@ -122,16 +122,17 @@ nsLocaleService::nsLocaleService(void)
|
2011-09-26 15:57:38 +02:00
|
|
|
nsRefPtr<nsLocale> resultLocale(new nsLocale());
|
2013-09-16 11:26:56 +02:00
|
|
|
NS_ENSURE_TRUE_VOID(resultLocale);
|
2011-06-28 20:42:13 +02:00
|
|
|
|
|
|
|
#ifdef MOZ_WIDGET_QT
|
2013-09-16 11:26:56 +02:00
|
|
|
const char* lang = QLocale::system().name().toUtf8();
|
2011-06-28 20:42:13 +02:00
|
|
|
#else
|
2011-09-26 15:57:38 +02:00
|
|
|
// Get system configuration
|
|
|
|
const char* lang = getenv("LANG");
|
|
|
|
+ const char* language = getenv("LANGUAGE");
|
2011-06-28 20:42:13 +02:00
|
|
|
#endif
|
|
|
|
|
2011-09-26 15:57:38 +02:00
|
|
|
nsAutoString xpLocale, platformLocale;
|
|
|
|
nsAutoString category, category_platform;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for( i = 0; i < LocaleListLength; i++ ) {
|
|
|
|
nsresult result;
|
2014-07-28 15:29:31 +02:00
|
|
|
@@ -150,16 +151,21 @@ nsLocaleService::nsLocaleService(void)
|
2011-09-26 15:57:38 +02:00
|
|
|
} else {
|
|
|
|
CopyASCIItoUTF16(lang, platformLocale);
|
|
|
|
result = nsPosixLocale::GetXPLocale(lang, xpLocale);
|
2011-06-28 20:42:13 +02:00
|
|
|
}
|
|
|
|
}
|
2011-09-26 15:57:38 +02:00
|
|
|
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);
|
2011-06-28 20:42:13 +02:00
|
|
|
|
|
|
|
#endif // XP_UNIX
|
2014-07-28 15:29:31 +02:00
|
|
|
|