--- a/MozillaFirefox/MozillaFirefox.changes Sun Jan 22 17:43:03 2017 +0100
+++ b/MozillaFirefox/MozillaFirefox.changes Tue Jan 24 22:19:01 2017 +0100
@@ -16,6 +16,8 @@
- switch Firefox to Gtk3 for Tumbleweed and Leap >= 43
- removed obsolete patches
* mozilla-flex_buffer_overrun.patch
+- updated RPM locale support tag
+- improve recognition of LANGUAGE env variable (boo#1017174)
-------------------------------------------------------------------
Mon Dec 12 21:18:41 UTC 2016 - wr@rosenauer.org
--- a/MozillaFirefox/MozillaFirefox.spec Sun Jan 22 17:43:03 2017 +0100
+++ b/MozillaFirefox/MozillaFirefox.spec Tue Jan 24 22:19:01 2017 +0100
@@ -36,7 +36,7 @@
%define pkgname firefox-dev-edition
%define appname Firefox Developer Edition
%endif
-%if 0%{?suse_version} > 1315
+%if 0%{?suse_version} > 1320
%define firefox_use_gtk3 1
%endif
%define progdir %{_prefix}/%_lib/%{progname}
@@ -205,7 +205,7 @@
%package translations-other
Summary: Extra translations for %{appname}
Group: System/Localization
-Provides: locale(%{name}:ach;af;an;as;ast;az;be;bg;bn_BD;bn_IN;br;bs;cak;cy;dsb;en_ZA;eo;es_MX;et;eu;fa;ff;fy_NL;ga_IE;gd;gl;gn;gu_IN;he;hi_IN;hr;hsb;hy_AM;id;is;kk;km;kn;lij;lt;lv;mai;mk;ml;mr;ms;nn_NO;or;pa_IN;rm;ro;si;sk;sl;son;sq;sr;ta;te;th;tr;uk;uz;vi;xh)
+Provides: locale(%{name}:ach;af;an;as;ast;az;bg;bn_BD;bn_IN;br;bs;cak;cy;dsb;en_ZA;eo;es_MX;et;eu;fa;ff;fy_NL;ga_IE;gd;gl;gn;gu_IN;he;hi_IN;hr;hsb;hy_AM;id;is;ka;kab;kk;km;kn;lij;lt;lv;mai;mk;ml;mr;ms;nn_NO;or;pa_IN;rm;ro;si;sk;sl;son;sq;sr;ta;te;th;tr;uk;uz;vi;xh)
Requires: %{name} = %{version}
Obsoletes: %{name}-translations < %{version}-%{release}
@@ -398,9 +398,9 @@
%if %localize
rm -f %{_tmppath}/translations.*
touch %{_tmppath}/translations.{common,other}
-for locale in $(awk '{ print $1; }' ../mozilla/browser/locales/shipped-locales); do
+for locale in $(awk '{ print $1; }' %{SOURCE17}); do
case $locale in
- ja-JP-mac|en-US)
+ ja-JP-mac|en-US|'')
;;
*)
pushd $RPM_BUILD_DIR/compare-locales
--- a/mozilla-language.patch Sun Jan 22 17:43:03 2017 +0100
+++ b/mozilla-language.patch Tue Jan 24 22:19:01 2017 +0100
@@ -1,7 +1,7 @@
# HG changeset patch
# User Wolfgang Rosenauer <wr@rosenauer.org>
# Parent 5a29924228527f8882c83cf62d470963ea1ce62e
-# Parent bf7b3a5853467b34f13465102a19b9c7c2524bd4
+# Parent 4f39ed617c2f151a3a15903c7ae4471b66774e9e
Bug 583793 - Firefox interface language set to LANG, ignores LANGUAGE
diff --git a/intl/locale/nsLocaleService.cpp b/intl/locale/nsLocaleService.cpp
@@ -25,7 +25,7 @@
for( i = 0; i < LocaleListLength; i++ ) {
nsresult result;
// setlocale( , "") evaluates LC_* and LANG
-@@ -149,16 +150,21 @@ nsLocaleService::nsLocaleService(void)
+@@ -149,16 +150,36 @@ nsLocaleService::nsLocaleService(void)
} else {
CopyASCIItoUTF16(lang, platformLocale);
result = nsPosixLocale::GetXPLocale(lang, xpLocale);
@@ -35,9 +35,24 @@
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) {
-+ CopyASCIItoUTF16(language, platformLocale);
-+ result = nsPosixLocale::GetXPLocale(language, xpLocale);
++#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);