1 # HG changeset patch |
1 # HG changeset patch |
2 # User Wolfgang Rosenauer <wr@rosenauer.org> |
2 # User Wolfgang Rosenauer <wr@rosenauer.org> |
3 # Parent 4a8194d5971401441da4f4f3bbd2730e506da4bc |
3 # Parent 05766406681babf9a5a433649b5ba2b9741b9962 |
4 Bug 583793 - Firefox interface language set to LANG, ignores LANGUAGE |
4 Bug 583793 - Firefox interface language set to LANG, ignores LANGUAGE |
5 |
5 |
6 diff --git a/intl/locale/src/nsLocaleService.cpp b/intl/locale/src/nsLocaleService.cpp |
6 diff --git a/intl/locale/src/nsLocaleService.cpp b/intl/locale/src/nsLocaleService.cpp |
7 --- a/intl/locale/src/nsLocaleService.cpp |
7 --- a/intl/locale/src/nsLocaleService.cpp |
8 +++ b/intl/locale/src/nsLocaleService.cpp |
8 +++ b/intl/locale/src/nsLocaleService.cpp |
9 @@ -192,22 +192,24 @@ nsLocaleService::nsLocaleService(void) |
9 @@ -181,16 +181,17 @@ nsLocaleService::nsLocaleService(void) |
10 return; |
|
11 } |
10 } |
12 |
11 |
13 #ifdef MOZ_ENABLE_MEEGOTOUCH |
12 |
14 // Create a snapshot of the gconf locale values into the |
13 #ifdef MOZ_WIDGET_QT |
15 // corresponding environment variables to obey system settings |
14 const char* lang = QLocale::languageToString(QLocale::system().language()).toAscii(); |
16 // as accurately as possible. |
15 #else |
17 CopyGConfToEnv("/meegotouch/i18n/language", "LANG"); |
16 // Get system configuration |
18 + CopyGConfToEnv("/meegotouch/i18n/language", "LANGUAGE"); |
17 const char* lang = getenv("LANG"); |
19 CopyGConfToEnv("/meegotouch/i18n/lc_collate", NSILOCALE_COLLATE); |
18 + const char* language = getenv("LANGUAGE"); |
20 CopyGConfToEnv("/meegotouch/i18n/lc_monetary", NSILOCALE_MONETARY); |
|
21 CopyGConfToEnv("/meegotouch/i18n/lc_numeric", NSILOCALE_NUMERIC); |
|
22 CopyGConfToEnv("/meegotouch/i18n/lc_time", NSILOCALE_TIME); |
|
23 #endif |
19 #endif |
24 // Get system configuration |
20 |
25 + const char* language = getenv("LANGUAGE"); |
|
26 const char* lang = getenv("LANG"); |
|
27 for( i = 0; i < LocaleListLength; i++ ) { |
21 for( i = 0; i < LocaleListLength; i++ ) { |
28 nsresult result; |
22 nsresult result; |
29 // setlocale( , "") evaluates LC_* and LANG |
23 // setlocale( , "") evaluates LC_* and LANG |
30 char* lc_temp = setlocale(posix_locale_category[i], ""); |
24 char* lc_temp = setlocale(posix_locale_category[i], ""); |
31 CopyASCIItoUTF16(LocaleList[i], category); |
25 CopyASCIItoUTF16(LocaleList[i], category); |
32 category_platform = category; |
26 category_platform = category; |
33 category_platform.AppendLiteral("##PLATFORM"); |
27 @@ -206,16 +207,21 @@ nsLocaleService::nsLocaleService(void) |
34 @@ -222,16 +224,21 @@ nsLocaleService::nsLocaleService(void) |
|
35 else { |
28 else { |
36 CopyASCIItoUTF16(lang, platformLocale); |
29 CopyASCIItoUTF16(lang, platformLocale); |
37 result = posixConverter->GetXPLocale(lang, xpLocale); |
30 result = posixConverter->GetXPLocale(lang, xpLocale); |
38 } |
31 } |
39 } |
32 } |