2011-06-01 08:05:09 +02:00
|
|
|
# HG changeset patch
|
|
|
|
# User Wolfgang Rosenauer <wr@rosenauer.org>
|
2011-09-26 08:53:33 +02:00
|
|
|
# Parent 0d6917b8f28f6e0398dbf329dda4932ba4f997c2
|
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
|
2011-09-26 08:53:33 +02:00
|
|
|
@@ -160,16 +160,17 @@ nsLocaleService::nsLocaleService(void)
|
|
|
|
nsRefPtr<nsLocale> resultLocale(new nsLocale());
|
|
|
|
NS_ENSURE_TRUE(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;
|
|
|
|
@@ -188,16 +189,21 @@ nsLocaleService::nsLocaleService(void)
|
|
|
|
} 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
|