2011-06-01 08:05:09 +02:00
|
|
|
# HG changeset patch
|
|
|
|
# User Wolfgang Rosenauer <wr@rosenauer.org>
|
2013-01-07 21:49:28 +01:00
|
|
|
# Parent 97c6ae4c21e703a18e04f4d9fae9e2f06aeb13df
|
2011-06-01 08:05:09 +02:00
|
|
|
Bug 583793 - Firefox interface language set to LANG, ignores LANGUAGE
|
|
|
|
|
|
|
|
diff --git a/intl/locale/src/nsLocaleService.cpp b/intl/locale/src/nsLocaleService.cpp
|
|
|
|
--- a/intl/locale/src/nsLocaleService.cpp
|
|
|
|
+++ b/intl/locale/src/nsLocaleService.cpp
|
2013-01-07 21:49:28 +01:00
|
|
|
@@ -127,16 +127,17 @@ nsLocaleService::nsLocaleService(void)
|
2011-09-26 08:53:33 +02:00
|
|
|
nsRefPtr<nsLocale> resultLocale(new nsLocale());
|
2013-01-07 21:49:28 +01:00
|
|
|
NS_ENSURE_TRUE_VOID(resultLocale);
|
2011-06-01 08:05:09 +02:00
|
|
|
|
|
|
|
#ifdef MOZ_WIDGET_QT
|
2011-09-26 08:53:33 +02:00
|
|
|
const char* lang = QLocale::system().name().toAscii();
|
2011-06-01 08:05:09 +02:00
|
|
|
#else
|
2011-09-26 08:53:33 +02:00
|
|
|
// Get system configuration
|
|
|
|
const char* lang = getenv("LANG");
|
|
|
|
+ const char* language = getenv("LANGUAGE");
|
2011-06-01 08:05:09 +02:00
|
|
|
#endif
|
|
|
|
|
2011-09-26 08:53:33 +02:00
|
|
|
nsAutoString xpLocale, platformLocale;
|
|
|
|
nsAutoString category, category_platform;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for( i = 0; i < LocaleListLength; i++ ) {
|
|
|
|
nsresult result;
|
2013-01-07 21:49:28 +01:00
|
|
|
@@ -155,16 +156,21 @@ nsLocaleService::nsLocaleService(void)
|
2011-09-26 08:53:33 +02:00
|
|
|
} else {
|
|
|
|
CopyASCIItoUTF16(lang, platformLocale);
|
|
|
|
result = nsPosixLocale::GetXPLocale(lang, xpLocale);
|
2011-06-01 08:05:09 +02:00
|
|
|
}
|
|
|
|
}
|
2011-09-26 08:53:33 +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-01 08:05:09 +02:00
|
|
|
|
|
|
|
#endif // XP_UNIX
|
2011-09-26 08:53:33 +02:00
|
|
|
#ifdef XP_OS2
|