forked from pool/MozillaThunderbird
d6fa566d17
* Optionally remove corresponding data files when removing an account * Possibility to copy message filter * Calendar: Event can now be created and edited in a tab * Calendar: Processing of received invitation counter proposals * Chat: Support Twitter Direct Messages * Chat: Liking and favoriting in Twitter * Chat: Removed Yahoo! Messenger support * serveral bugfixes - removed obsolete patches * mozilla-aarch64-48bit-va.patch * mozilla-binutils-visibility.patch * mozilla-flex_buffer_overrun.patch * mozilla-gcc6.patch - added generic mozilla patches * mozilla-aarch64-startup-crash.patch - require newer versions of NSPR and NSS OBS-URL: https://build.opensuse.org/package/show/mozilla:Factory/MozillaThunderbird?expand=0&rev=358
65 lines
2.4 KiB
Diff
65 lines
2.4 KiB
Diff
# HG changeset patch
|
|
# User Wolfgang Rosenauer <wr@rosenauer.org>
|
|
# Parent 5a29924228527f8882c83cf62d470963ea1ce62e
|
|
# Parent 4f39ed617c2f151a3a15903c7ae4471b66774e9e
|
|
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
|
|
@@ -114,16 +114,17 @@ nsLocaleService::nsLocaleService(void)
|
|
NS_ENSURE_SUCCESS_VOID(rv);
|
|
#endif
|
|
#if defined(XP_UNIX) && !defined(XP_MACOSX)
|
|
RefPtr<nsLocale> resultLocale(new nsLocale());
|
|
NS_ENSURE_TRUE_VOID(resultLocale);
|
|
|
|
// Get system configuration
|
|
const char* lang = getenv("LANG");
|
|
+ const char* language = getenv("LANGUAGE");
|
|
|
|
nsAutoString xpLocale, platformLocale;
|
|
nsAutoString category, category_platform;
|
|
int i;
|
|
|
|
for( i = 0; i < LocaleListLength; i++ ) {
|
|
nsresult result;
|
|
// setlocale( , "") evaluates LC_* and LANG
|
|
@@ -149,16 +150,36 @@ nsLocaleService::nsLocaleService(void)
|
|
} else {
|
|
CopyASCIItoUTF16(lang, platformLocale);
|
|
result = nsPosixLocale::GetXPLocale(lang, xpLocale);
|
|
}
|
|
}
|
|
if (NS_FAILED(result)) {
|
|
return;
|
|
}
|
|
+ // LANGUAGE is overriding LC_MESSAGES
|
|
+ // it can be a colon separated list of preferred languages
|
|
+ // as we do not recognize here if a language is available
|
|
+ // we actually only consider the first entry unless GetXPLocale
|
|
+ // fails completely
|
|
+ if (i == LC_MESSAGES && language && *language) {
|
|
+#define LANGUAGE_SEP ":"
|
|
+ nsAutoString xpLocale_temp;
|
|
+ char* rawBuffer = (char*) language;
|
|
+ char* token = nsCRT::strtok(rawBuffer, LANGUAGE_SEP, &rawBuffer);
|
|
+ for (; token;
|
|
+ token = nsCRT::strtok(rawBuffer, LANGUAGE_SEP, &rawBuffer)) {
|
|
+ result = nsPosixLocale::GetXPLocale(token, xpLocale_temp);
|
|
+ if (NS_SUCCEEDED(result)) {
|
|
+ CopyASCIItoUTF16(token, platformLocale);
|
|
+ xpLocale = xpLocale_temp;
|
|
+ break;
|
|
+ }
|
|
+ }
|
|
+ }
|
|
resultLocale->AddCategory(category, xpLocale);
|
|
resultLocale->AddCategory(category_platform, platformLocale);
|
|
}
|
|
mSystemLocale = do_QueryInterface(resultLocale);
|
|
mApplicationLocale = do_QueryInterface(resultLocale);
|
|
|
|
#endif // XP_UNIX
|
|
|