MozillaFirefox/mozilla-language.patch

50 lines
1.8 KiB
Diff
Raw Normal View History

# HG changeset patch
# User Wolfgang Rosenauer <wr@rosenauer.org>
# Parent 5a29924228527f8882c83cf62d470963ea1ce62e
# Parent bf7b3a5853467b34f13465102a19b9c7c2524bd4
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,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