Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 189647 - mozilla-firefox-2.0.0.6 install ignores locale
Summary: mozilla-firefox-2.0.0.6 install ignores locale
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Mozilla Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-08-20 22:14 UTC by Chris Bainbridge (RETIRED)
Modified: 2008-04-10 22:46 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
mozilla-firefox-2.0.0.6.ebuild.diff (mozilla-firefox-2.0.0.6.ebuild.diff,3.19 KB, patch)
2007-09-03 13:15 UTC, Chris Bainbridge (RETIRED)
Details | Diff
mozilla-firefox-2.0.0.11.ebuild (firefox.ebuild,9.65 KB, text/plain)
2007-12-22 11:05 UTC, Raúl Porcel (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Bainbridge (RETIRED) gentoo-dev 2007-08-20 22:14:47 UTC
I installed mozilla-firefox with en_GB locale built with LINGUAS flag. The search box should show UK sites - ebay.co.uk, yahoo.co.uk, chambers (uk) etc. but instead shows the .com sites. 

Tested with binary from mozilla.org and it works fine, so problem is somewhere in Gentoo build. I see it installing the correct language pack:

 * Unpacking mozilla-firefox-2.0.0.6-en-GB.xpi to /tmp/portage/www-client/mozilla-firefox-2.0.0.6/work   
 * Selected language packs (first will be default): en-GB     

Maybe it's missing something else that configures a different locale build?
Comment 1 Chris Bainbridge (RETIRED) gentoo-dev 2007-08-21 11:54:04 UTC
It must be possible to select the locale somehow at build/install time. /usr/lib/mozilla-firefox/browserconfig.properties has en-US locale by default:

browser.startup.homepage=http://en-US.start2.mozilla.com/firefox?client=firefox-a&rls=org.mozilla:en-US:official

With en-GB firefox it should be (confirmed in official binary download):

browser.startup.homepage=http://en-GB.start2.mozilla.com/firefox?client=firefox-a&rls=org.mozilla:en-GB:official
Comment 2 Chris Bainbridge (RETIRED) gentoo-dev 2007-08-21 13:02:22 UTC
I think you want something like this in src_compile (instead of the instead of the sed in src_install):

    linguas
    local LANG=${linguas%% *}
    if [[ -n ${LANG} && ${LANG} != "en" ]]; then
        elog "Setting default locale to ${LANG}"
        mozconfig_annotate '' --enable-ui-locale=${LANG}
    fi

I tried, it seems to work until the error: 

gmake[3]: Entering directory `/tmp/portage/www-client/mozilla-firefox-2.0.0.6/work/mozilla/netwerk/locales'
error: file '../../../l10n/en-GB/netwerk/necko.properties' doesn't exist at ../../config/make-jars.pl line 443, <STDIN> line 4.
+++ making chrome /tmp/portage/www-client/mozilla-firefox-2.0.0.6/work/mozilla/netwerk/locales  => ../../dist/bin/chrome/en-GB.jar

Looks like it needs some locale files from somewhere, possibly the unpacked .xpi.
Comment 3 garyyuen 2007-09-03 08:56:21 UTC
I have a related problem. I built firefox with Chinese locales. The language packs are installed, show up in addons, but aren't used. This is when my LANG environment is set to zh_CN.UTF8 and Gnome is properly localized. 
Comment 4 Chris Bainbridge (RETIRED) gentoo-dev 2007-09-03 13:15:59 UTC
Created attachment 129917 [details, diff]
mozilla-firefox-2.0.0.6.ebuild.diff

The problem seems to be that rather than build the locale data the ebuild
uses a pre-prepared .xpi file which only contains some of the locale data.

The locale source required isn't distributed with the firefox source.  To get it
do:

cvs -d ':pserver:anonymous@cvs-mirror.mozilla.org:/l10n' export -r FIREFOX_2_0_0_6_RELEASE l10n
tar -jcvf firefox-2.0.0.6-l10n.tar.bz2 l10n/
mv firefox-2.0.0.6-l10n.tar.bz2 /usr/portage/distfiles/

This .bz2 file should be about 15MB. Now use the attached ebuild diff and
firefox should be properly localised.

This will also clean the ebuild up a bit. The XPI stuff is no longer necessary,
so we can get rid of it and remove /usr/portage/eclass/mozextension.eclass if
its not used in any other package.
Comment 5 Chris Bainbridge (RETIRED) gentoo-dev 2007-10-27 12:28:44 UTC
Can someone please apply this fix?
Comment 6 Raúl Porcel (RETIRED) gentoo-dev 2007-12-20 16:08:01 UTC
(In reply to comment #4)
> The XPI stuff is no longer necessary,
> so we can get rid of it and remove /usr/portage/eclass/mozextension.eclass if
> its not used in any other package.
> 

OMG, eclasses never get removed! I'm going to have a look at this.
Comment 7 Raúl Porcel (RETIRED) gentoo-dev 2007-12-22 11:05:02 UTC
Created attachment 139088 [details]
mozilla-firefox-2.0.0.11.ebuild

Okay, here's the thing. If we do it the way you proposed, then you can't build more than one locale.

I've working in another approach, try the ebuild i'm attaching and let me know if that's enough. The homepage is different for each locale and you have the search stuff.
Comment 8 Chris Bainbridge (RETIRED) gentoo-dev 2007-12-22 12:49:08 UTC
I'll try it if I have some free time, probably in January. But some comments from just skimming the code: you aren't using --enable-ui-locale, as far as I can see you're still just sed substituting $LANG in some of the config files; does your ebuild give the proper localised GUI interface (e.g. with en_GB locale, yahoo.co.uk, ebay.co.uk etc. should appear in the search box by default).

"If we do it the way you proposed, then you can't build
more than one locale" Probably true, but this seems to be a limitation of the upstream code (although I'm not sure - what happens if you set more than one --enable-ui-locale option?). Also, is it even possible to do this properly - as far as I can see no binary download of Firefox supports more than one locale; they ship a different binary download for every locale. I presume if it were possible to support more than one UI locale at the same time, then upstream would ship a single unified binary.
Comment 9 Raúl Porcel (RETIRED) gentoo-dev 2007-12-22 13:03:47 UTC
(In reply to comment #8)
> I'll try it if I have some free time, probably in January. But some comments
> from just skimming the code: you aren't using --enable-ui-locale, as far as I
> can see you're still just sed substituting $LANG in some of the config files;
> does your ebuild give the proper localised GUI interface (e.g. with en_GB
> locale, yahoo.co.uk, ebay.co.uk etc. should appear in the search box by
> default).
I already told you that:
The homepage is different for each locale and you have the
_search stuff_.

> 
> "If we do it the way you proposed, then you can't build
> more than one locale" Probably true, but this seems to be a limitation of the
> upstream code (although I'm not sure - what happens if you set more than one
> --enable-ui-locale option?). Also, is it even possible to do this properly - as
> far as I can see no binary download of Firefox supports more than one locale;
> they ship a different binary download for every locale. I presume if it were
> possible to support more than one UI locale at the same time, then upstream
> would ship a single unified binary.
> 
Well, what you want(the homepage and the search stuff) it's already included in the new xpi's i made.
Just compare these dirs:
http://dev.gentooexperimental.org/~armin76/dist/mozilla-firefox-2.0.0.11-xpi/
http://dev.gentooexperimental.org/~armin76/dist/mozilla-firefox-2.0.0.11-2-xpi/

As you see, the later dir has the xpi's which are ~10kb bigger. The ebuild i attached is just using the second dir which contains the new xpi's.
The first xpi's are provided by upstream:
ftp://ftp.mozilla.org/pub/firefox/releases/2.0.0.11/linux-i686/xpi

They're just downloaded, renamed, and mirrored. But as you already noted, they don't contain the search stuff, which is called search plugins. The second ones are built by me, it's just the same, but including all dirs provided by the CVS checkout.

So doing what you proposed, we could only build one locale, and that's just plain useless, because everytime you wanted to change the locale, you'll have to rebuild firefox. And for only the search plugins is just stupid. So it's better to fix the xpi's instead, and that's what i did :)

The bad thing is just that it'll show all the search plugins from the locales you have installed, but i guess that's better than nothing.

Comment 10 Chris Bainbridge (RETIRED) gentoo-dev 2007-12-22 16:57:54 UTC
Thanks for your reply; gave me the motivation to have a quick look. Two problems:

The file names haven't changed so the digests collide with the old file digests and emerge complains.  

I have only en_GB locale and only en_GB in LINGUAS, but it seems I now have both the .com and .co.uk versions of yahoo, ebay and amazon in the search box?
Comment 11 Raúl Porcel (RETIRED) gentoo-dev 2007-12-22 18:37:39 UTC
(In reply to comment #10)
> Thanks for your reply; gave me the motivation to have a quick look. Two
> problems:
> 
> The file names haven't changed so the digests collide with the old file digests
> and emerge complains.  
> 
Well, this is just a test, just emerge it with --digest

> I have only en_GB locale and only en_GB in LINGUAS, but it seems I now have
> both the .com and .co.uk versions of yahoo, ebay and amazon in the search box?
> 
Already explained that:
The bad thing is just that it'll show all the search plugins from the locales
you have installed, but i guess that's better than nothing.

I guess that's the reason why upstream have a binary for every locale :)
Comment 12 Chris Bainbridge (RETIRED) gentoo-dev 2007-12-22 18:57:56 UTC
But I only have en_GB lingua set. Why am I getting en_US as well? 
Comment 13 Raúl Porcel (RETIRED) gentoo-dev 2007-12-22 19:25:30 UTC
(In reply to comment #12)
> But I only have en_GB lingua set. Why am I getting en_US as well? 
> 

Because that's the default. You can't remove it unless you use the option you want to use. This is the maximum you can do without removing the capability of having multiple locales in the same build.
Comment 14 Davide Pesavento (RETIRED) gentoo-dev 2008-04-10 22:09:24 UTC
(Not sure the problem is the same as the original poster's one...)

I upgraded to mozilla-firefox-3.0_beta5 with USE="xulrunner" and LINGUAS="it". Then I started firefox and noticed that the user interface was *not* localized.
After a bit of debugging I found that the jar file with italian localization was not installed, and I also noticed the following error during src_unpack():

>>> Unpacking source...
>>> Unpacking mozilla-firefox-3.0_beta5.tar.bz2 to /var/tmp/portage/www-client/mozilla-firefox-3.0_beta5/work
>>> Unpacking mozilla-firefox-3.0_beta5-patches-0.1.tar.bz2 to /var/tmp/portage/www-client/mozilla-firefox-3.0_beta5/work
/var/tmp/portage/www-client/mozilla-firefox-3.0_beta5/temp/environment: line 3219: xpi_unpack: command not found
 * Selected language packs (first will be default): it

and this one in src_install():

/var/tmp/portage/www-client/mozilla-firefox-3.0_beta5/temp/environment: line 3179: xpi_install: command not found
 * Setting default locale to it
Comment 15 Raúl Porcel (RETIRED) gentoo-dev 2008-04-10 22:46:36 UTC
(In reply to comment #14)
> (Not sure the problem is the same as the original poster's one...)
> 
> I upgraded to mozilla-firefox-3.0_beta5 with USE="xulrunner" and LINGUAS="it".
> Then I started firefox and noticed that the user interface was *not* localized.
> After a bit of debugging I found that the jar file with italian localization
> was not installed, and I also noticed the following error during src_unpack():
> 
> >>> Unpacking source...
> >>> Unpacking mozilla-firefox-3.0_beta5.tar.bz2 to /var/tmp/portage/www-client/mozilla-firefox-3.0_beta5/work
> >>> Unpacking mozilla-firefox-3.0_beta5-patches-0.1.tar.bz2 to /var/tmp/portage/www-client/mozilla-firefox-3.0_beta5/work
> /var/tmp/portage/www-client/mozilla-firefox-3.0_beta5/temp/environment: line
> 3219: xpi_unpack: command not found
>  * Selected language packs (first will be default): it
> 
> and this one in src_install():
> 
> /var/tmp/portage/www-client/mozilla-firefox-3.0_beta5/temp/environment: line
> 3179: xpi_install: command not found
>  * Setting default locale to it
> 

Fixed, sync in an hour or so and try again.

Meanwhile i'm closing this bug, sice its useless.