Hi Takao,

I think we don't need to introduce DEF_LOCALE, because in this patch  
DEF_LOCALE is either as same as AB_CD or as string "chrome://global/ 
locale/intl.properties".

In firefox/browser/locales/en-US/firefox-l10n.js, we can just write
+pref("general.useragent.locale", "chrome://global/locale/ 
intl.properties");

And we don't need to change other source files.

Does it work?

Thanks,

Ginn

On Apr 10, 2008, at 11:01 PM, Takao Fujiwara - Tokyo S/W Center wrote:

> Hi,
>
> I'ld like to integrate this fix into both Vermillion and Indiana.
> Now Getting Started Guide is integrated in Indiana and I put the  
> index.html which tries to switch localized index.html with JavaScript.
> But currently the JavaScript value is always returned "en-US".
>
> Then I would think the two solutions:
> One is we fix the firefox bug and another is to stop the JavaScript  
> and show the language page links including English.
> Since the visibility is very high, I'ld like to consider to fix the  
> Firefox with the attahed patch. Ginn Chen helped me for the patch.
>
> Thanks,
> fujiwara
> --- firefox/browser/locales/Makefile.in.orig  2008-04-10  
> 13:10:58.189907000 +0900
> +++ firefox/browser/locales/Makefile.in       2008-04-10  
> 13:11:48.413393000 +0900
> @@ -67,6 +67,7 @@ APP_VERSION := $(shell cat $(srcdir)/../
>
> DEFINES += \
>       -DAB_CD=$(AB_CD) \
> +     -DDEF_LOCALE=$(DEF_LOCALE) \
>       -DMOZ_LANGPACK_EID=langpack-$(AB_CD)@firefox.mozilla.org \
>       -DMOZ_APP_VERSION=$(MOZ_APP_VERSION) \
>       -DLOCALE_SRCDIR=$(LOCALE_SRCDIR) \
> @@ -166,7 +167,7 @@ libs-%:
>       @$(MAKE) -C ../../toolkit/locales libs-$*
>       @$(MAKE) -C ../../extensions/reporter/locales libs AB_CD=$*  
> XPI_NAME=locale-$*
>       @$(MAKE) -C ../../extensions/spellcheck/locales AB_CD=$*  
> XPI_NAME=locale-$*
> -     @$(MAKE) libs AB_CD=$* XPI_NAME=locale-$* PREF_DIR=defaults/pref
> +     @$(MAKE) libs AB_CD=$* DEF_LOCALE=$* XPI_NAME=locale-$*  
> PREF_DIR=defaults/pref
> ifdef MOZ_BRANDING_DIRECTORY
>       @$(MAKE) -C $(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/locales AB_CD=$*  
> XPI_NAME=locale-$*
> endif
> --- firefox/browser/locales/en-US/firefox-l10n.js.orig        2008-04-10  
> 12:28:26.333854000 +0900
> +++ firefox/browser/locales/en-US/firefox-l10n.js     2008-04-10  
> 12:49:54.308445000 +0900
> @@ -36,4 +36,4 @@
>
> #filter substitution
>
> -pref("general.useragent.locale", "@AB_CD@");
> +pref("general.useragent.locale", "@DEF_LOCALE@");
> --- firefox/config/config.mk.orig     2008-04-10 13:04:24.154782000 +0900
> +++ firefox/config/config.mk  2008-04-10 13:10:25.106980000 +0900
> @@ -849,6 +849,9 @@ endif
> # MOZ_UI_LOCALE directly, but use an intermediate variable that can be
> # overridden by the command line. (Besides, AB_CD is prettier).
> AB_CD = $(MOZ_UI_LOCALE)
> +# Available "LANG" for DEF_LOCALE instead of "en-US". make  
> DEF_LOCALE=LANG
> +# DEF_LOCALE for "general.useragent.locale"
> +DEF_LOCALE = $(MOZ_UI_LOCALE)
>
> EXPAND_LOCALE_SRCDIR = $(if $(filter en-US,$(AB_CD)),$(topsrcdir)/ 
> $(1)/en-US,$(topsrcdir)/../l10n/$(AB_CD)/$(subst /locales,,$(1)))
>
> --- spec-files/base-specs/firefox.spec.orig   2008-04-10  
> 13:23:25.439252000 +0900
> +++ spec-files/base-specs/firefox.spec        2008-04-10 23:50:34.462662000  
> +0900
> @@ -112,6 +112,10 @@ Patch18: mozilla-08-cairo-update.diff
> # owner:hawklu date:2007-11-07 type:bug
> Patch19: firefox-15-remove-core-file-check.diff
>
> +# owner:fujiwara date:2008-04-10 type:bug
> +# bugster:6686579 bugzilla:285267
> +Patch20: firefox-20-g11n-nav-lang.diff
> +
> URL:         http://www.sun.com/software/javadesktopsystem/
>
> BuildRoot:   %{_tmppath}/%{name}-%{tarball_version}-build
> @@ -195,6 +199,7 @@ cd %{name}
> %patch16 -p1
> %patch18 -p1
> %patch19 -p1
> +%patch20 -p1
>
> #####################################
> ##      Package Build Section      ##
> @@ -249,18 +254,18 @@ PKG_SKIP_STRIP=1
> export BUILD_OFFICIAL MOZILLA_OFFICIAL MOZ_PKG_FORMAT PKG_SKIP_STRIP  
> CFLAGS CXXFLAGS
>
> ./configure
> -make export
> +make DEF_LOCALE=chrome://global/locale/intl.properties export
> # FIXME: disabled parallel build as it seems to break the build  
> sometimes
> -make libs
> +make DEF_LOCALE=chrome://global/locale/intl.properties libs
>
> cd xpinstall/packager
> -make
> +make DEF_LOCALE=chrome://global/locale/intl.properties
>
> %install
> /bin/rm -rf $RPM_BUILD_ROOT
>
> DESTDIR=$RPM_BUILD_ROOT \
> -    make install
> +    make DEF_LOCALE=chrome://global/locale/intl.properties install
> /bin/rm -rf $RPM_BUILD_ROOT%{_ffdir}
> BUILDDIR=`pwd`
> cd $RPM_BUILD_ROOT%{_libdir}
> @@ -358,6 +363,9 @@ rmdir $RPM_BUILD_ROOT%{_ffdir}/dictionar
> %{_datadir}/pixmaps/%{name}-icon.png
>
> %changelog
> +* Thu Apr 10 2008 - takao.fujiwara at sun.com
> +- Add firefox-20-g11n-nav-lang.diff to assine locales in
> +  general.useragent.locale so that JavaScript navigator.language  
> works.
> * Fri Mar 28 2008 - dave.lin at sun.com
> - bump to 2.0.0.13
> * Sun Feb 10 2008 - dave.lin at sun.com
> --- firefox3/browser/locales/Makefile.in.orig 2008-01-23  
> 09:03:58.000000000 +0900
> +++ firefox3/browser/locales/Makefile.in      2008-04-10  
> 23:29:58.615452000 +0900
> @@ -70,6 +70,7 @@ core_abspath = $(if $(findstring :,$(1))
>
> DEFINES += \
>       -DAB_CD=$(AB_CD) \
> +     -DDEF_LOCALE=$(DEF_LOCALE) \
>       -DMOZ_LANGPACK_EID=langpack-$(AB_CD)@firefox.mozilla.org \
>       -DMOZ_APP_VERSION=$(MOZ_APP_VERSION) \
>       -DLOCALE_SRCDIR=$(call core_abspath,$(LOCALE_SRCDIR)) \
> @@ -175,7 +176,7 @@ libs-%:
>       @$(MAKE) -C ../../toolkit/locales libs-$*
>       @$(MAKE) -C ../../extensions/reporter/locales libs AB_CD=$*  
> XPI_NAME=locale-$*
>       @$(MAKE) -C ../../extensions/spellcheck/locales AB_CD=$*  
> XPI_NAME=locale-$*
> -     @$(MAKE) libs AB_CD=$* XPI_NAME=locale-$* PREF_DIR=defaults/pref
> +     @$(MAKE) libs AB_CD=$* DEF_LOCALE=$* XPI_NAME=locale-$*  
> PREF_DIR=defaults/pref
> ifdef MOZ_BRANDING_DIRECTORY
>       @$(MAKE) -C $(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/locales AB_CD=$*  
> XPI_NAME=locale-$*
> endif
> --- firefox3/browser/locales/en-US/firefox-l10n.js.orig       2008-04-10  
> 23:29:27.966806000 +0900
> +++ firefox3/browser/locales/en-US/firefox-l10n.js    2008-04-10  
> 23:29:58.618222000 +0900
> @@ -36,4 +36,4 @@
>
> #filter substitution
>
> -pref("general.useragent.locale", "@AB_CD@");
> +pref("general.useragent.locale", "@DEF_LOCALE@");
> --- firefox3/config/config.mk.orig    2008-01-26 02:14:53.000000000 +0900
> +++ firefox3/config/config.mk 2008-04-10 23:29:58.623158000 +0900
> @@ -859,6 +859,9 @@ endif
> # MOZ_UI_LOCALE directly, but use an intermediate variable that can be
> # overridden by the command line. (Besides, AB_CD is prettier).
> AB_CD = $(MOZ_UI_LOCALE)
> +# Available "LANG" for DEF_LOCALE instead of "en-US". make  
> DEF_LOCALE=LANG
> +# DEF_LOCALE for "general.useragent.locale"
> +DEF_LOCALE = $(MOZ_UI_LOCALE)
>
> EXPAND_LOCALE_SRCDIR = $(if $(filter en-US,$(AB_CD)),$(topsrcdir)/ 
> $(1)/en-US,$(topsrcdir)/../l10n/$(AB_CD)/$(subst /locales,,$(1)))
>
> --- spec-files/base-specs/firefox3.spec.orig  2008-04-10  
> 23:31:53.750079000 +0900
> +++ spec-files/base-specs/firefox3.spec       2008-04-10  
> 23:37:20.765106000 +0900
> @@ -102,6 +102,9 @@ Patch14: firefox3-14-no-launch-in-8-bit-
> # bugster:6656460
> Patch16: firefox3-16-crash-in-8-bit-mode.diff
>
> +# owner:fujiwara date:2008-04-10 type:bug
> +# bugster:6686579 bugzilla:285267
> +Patch17: firefox3-17-g11n-nav-lang.diff
>
> URL:         http://www.sun.com/software/javadesktopsystem/
>
> @@ -186,6 +189,7 @@ cd %{name}
> %endif
> %patch14 -p1
> %patch16 -p1
> +%patch17 -p1
>
> #####################################
> ##      Package Build Section      ##
> @@ -233,16 +237,16 @@ PKG_SKIP_STRIP=1
> export BUILD_OFFICIAL MOZILLA_OFFICIAL MOZ_PKG_FORMAT PKG_SKIP_STRIP  
> CFLAGS CXXFLAGS
>
> ./configure
> -make
> +make DEF_LOCALE=chrome://global/locale/intl.properties
>
> cd browser/installer
> -make
> +make DEF_LOCALE=chrome://global/locale/intl.properties
>
> %install
> /bin/rm -rf $RPM_BUILD_ROOT
>
> DESTDIR=$RPM_BUILD_ROOT \
> -    make install
> +    make DEF_LOCALE=chrome://global/locale/intl.properties install
> /bin/rm -rf $RPM_BUILD_ROOT%{_libdir}/*
> #/bin/rm -rf $RPM_BUILD_ROOT%{_bindir}/*
> /bin/rm -rf $RPM_BUILD_ROOT%{_bindir}
> @@ -344,6 +348,9 @@ install -c -m 644 %{SOURCE8} $RPM_BUILD_
> %{_datadir}/pixmaps/%{name}-icon.png
>
> %changelog
> +* Thu Apr 10 2008 - takao.fujiwara at sun.com
> +- Add firefox3-17-g11n-nav-lang.diff to assign locales in
> +  general.useragent.locale so that JavaScript navigator.language  
> works.
> * Thu Feb 28 2008 - brian.lu at sun.com
> - Remove the patch firefox3-10-cario-perf.diff
>   which causes a regression CR6668422

--------
Ginn Chen
Software Engineer, Browser Team
Sun Microsystems, Inc.
Phone: x82869 / +86-10-62673869
Fax: +86-10-62780969



Reply via email to