Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 305231 - <=mozilla-firefox-3.6-r2 user-agent string ignores LINGUAS="en_GB"
Summary: <=mozilla-firefox-3.6-r2 user-agent string ignores LINGUAS="en_GB"
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Mozilla Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 336136
  Show dependency tree
 
Reported: 2010-02-15 12:13 UTC by Robin Bankhead
Modified: 2011-12-14 14:11 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robin Bankhead 2010-02-15 12:13:46 UTC
This has probably been true for some time (i.e. since firefox-2.*), I've only just deduced this was why my Gentoo client box is being treated as American when I go to my horde-webmail login page.  (Windows clients are correctly identified as British.)

The en_GB language pack is correctly installed in Add-ons, however in Help > About..., the UA string is:

Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2) Gecko/20100214 Gentoo Firefox/3.6

Websites often make decisions about content based on the UA string (as in the case of horde-webmail's default selected language at login), so this should surely match the LINGUAS setting.

emerge --info:
Portage 2.1.7.17 (default/linux/x86/10.0/desktop, gcc-4.4.3, glibc-2.11-r1, 2.6.32-gentoo-r5 i686)
=================================================================                                 
System uname: Linux-2.6.32-gentoo-r5-i686-Intel-R-_Atom-TM-_CPU_N270_@_1.60GHz-with-gentoo-2.0.1  
Timestamp of tree: Sat, 13 Feb 2010 20:15:01 +0000                                                
distcc 3.1 i686-pc-linux-gnu [disabled]                                                           
ccache version 2.4 [enabled]                                                                      
app-shells/bash:     4.0_p37                                                                      
dev-java/java-config: 2.1.10                                                                      
dev-lang/python:     2.6.4-r1, 3.1.1-r1                                                           
dev-util/ccache:     2.4-r8                                                                       
dev-util/cmake:      2.8.0-r2                                                                     
sys-apps/baselayout: 2.0.1                                                                        
sys-apps/openrc:     0.6.0-r1                                                                     
sys-apps/sandbox:    2.2                                                                          
sys-devel/autoconf:  2.13, 2.65                                                                   
sys-devel/automake:  1.9.6-r2, 1.10.3, 1.11.1                                                     
sys-devel/binutils:  2.20                                                                         
sys-devel/gcc:       4.4.3                                                                        
sys-devel/gcc-config: 1.4.1                                                                       
sys-devel/libtool:   2.2.6b                                                                       
virtual/os-headers:  2.6.32                                                                       
ACCEPT_KEYWORDS="x86 ~x86"                                                                        
ACCEPT_LICENSE="*"                                                                                
CBUILD="i686-pc-linux-gnu"                                                                        
CFLAGS="-march=core2 -O2 -fomit-frame-pointer -pipe -mmmx -msse -msse2 -mssse3"                   
CHOST="i686-pc-linux-gnu"                                                                         
CONFIG_PROTECT="/etc /etc/security/pam_mount.conf.xml /usr/share/X11/xkb /usr/share/apps/kdm/themes/oxygen/oxygen.xml /usr/share/config"                                                                                                                        
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"                                                                                                                 
CXXFLAGS="-march=core2 -O2 -fomit-frame-pointer -pipe -mmmx -msse -msse2 -mssse3"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests ccache distlocks fixpackages news protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="http://gentoo.virginmedia.com http://distfiles.gentoo.org http://www.ibiblio.org/pub/Linux/distributions/gentoo"
LDFLAGS="-Wl,-O1"
LINGUAS="en_GB"
MAKEOPTS="-j6"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage/layman/wirelay /usr/local/portage"
SYNC="rsync://brazil/gentoo-portage"
USE="X a52 aac acl acpi alsa apache2 berkdb bluetooth branding bzip2 cairo cdparanoia cdr chm cli clucene consolekit cracklib crypt cups cxx dbus dga dio dri dts dvd dvdread eds emboss encode evo faac faad fam ffmpeg firefox flac flash foomaticdb fortran fuse gdbm gif gimp glitz gnutls gpm hal iconv imagemagick innodb java java6 javascript jpeg kde lcms ldap libnotify libwww mad madwifi matroska mikmod mmx mmxext mng modules mp3 mp4 mpeg mplayer msn mudflap mysql ncurses nls nptl nptlonly nsplugin odbc offensive ogg opengl openmp oss pam pcmcia pcntl pcre pdf perl phonon plasma png posix ppds pppd python qt3support qt4 quicktime readline reflection samba scanner sdl semantic-desktop sesame2 session sharedmem soap sockets spell spl sqlite sqlite3 sse sse2 sse3 ssl ssse3 startup-notification svg sysfs tcpd theora threads thunar tiff tk tordns truetype unicode usb vcd vhosts vorbis webkit wifi win32codecs x264 x86 xcb xcomposite xine xinerama xml xmlrpc xorg xsl xulrunner xv xvid xvmc zlib" ALSA_CARDS="hda-intel" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en_GB" RUBY_TARGETS="ruby18" SANE_BACKENDS="hp net" USERLAND="GNU" VIDEO_CARDS="intel vesa"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 coran.fisher@gmail.com 2010-03-17 16:28:49 UTC
With the Japanese language pack installed (via  linguas_ja being set) my user agent string looks like this in 3.6-r4:
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2) Gecko/20100317 Gentoo Firefox/3.6

Comment 2 Robin Bankhead 2010-07-25 13:35:11 UTC
Ì've had a further look at this, and the issue with the UA string appears to come down to the preference general.useragent.locale, which is set in /usr/lib/mozilla-firefox/defaults/preferences/firefox.js

Grepping for "en-US" in /usr/lib/mozilla-firefox and subdirs turns up a few other instances where it appears to be hardcoded (as opposed to being a fallback default). See /usr/lib/mozilla-firefox/browserconfig.properties for example - perhaps this is where LINGUAS should be asserted?

As a non-educated type, I've no idea whether this is something that should be being overridden by the en-GB language pack; it seems that should be the case, but then again the browserconfig.properties file contains gentoo-specific items, so perhaps not.  Would welcome some feedback on this if only at the theoretical level.
Comment 3 coran.fisher@gmail.com 2010-09-01 05:52:36 UTC
Looks like this may be going away in Firefox 4? http://blog.mozilla.com/dwitte/2010/08/24/user-agent-string-changes-coming-in-firefox-4/
"The locale (e.g. "en-US; ") is gone. The locale of the browser is not always the same as the locale the user prefers to view content in — the HTTP Accept header is the recommended source of this information"
Comment 4 Robin Bankhead 2010-09-01 11:09:35 UTC
Be that as it may, FF3 is not going away as soon as FF4 rolls around, and this bug still stands.

I've done some trial and error, and it appears that the correct place for the change is in
/usr/lib/mozilla-firefox/defaults/preferences/firefox-l10n.js

The only line in that file (apart from comments) is:
pref("general.useragent.locale", "en-US");

This overrides the same setting in
/usr/lib/mozilla-firefox/defaults/preferences/firefox.js

I changed it to en-GB and the UA locale was changed accordingly. 
Comment 5 coran.fisher@gmail.com 2010-09-02 20:13:46 UTC
Thank you for the info I was able to successfully change my locale via your suggestion.  
Comment 6 Robin Bankhead 2010-09-02 22:02:04 UTC
Nae probs - I meant to delve deeper into this ages ago but forgot about it until you bumped the bug. I should add that the same pref can also be user-set in about:config.

In returning to this, a complication occurred to me: people may have multiple LINGUAS defined, so what then?

Then there is also the system LANG and locale settings.  Actually it's a bit of a can of worms, but there could be a "checklist" of things to look at when setting the Firefox locale I guess.
Comment 7 Jory A. Pratt gentoo-dev 2010-12-29 04:55:11 UTC
try setting 

pref("general.useragent.locale", "chrome://global/locale/intl.properties");

and let me know.
Comment 8 Robin Bankhead 2010-12-29 12:03:31 UTC
(In reply to comment #7)
> try setting 
> 
> pref("general.useragent.locale", "chrome://global/locale/intl.properties");
> 
> and let me know.
> 

The result of this is that that string (the chrome:// uri) appears in the UA string, as-is.
Comment 9 Jory A. Pratt gentoo-dev 2011-10-31 21:41:47 UTC
Are you still seeing this with firefox-7.0.1-r1?
Comment 10 Jory A. Pratt gentoo-dev 2011-12-12 16:33:27 UTC
Over a month with no input from user, feel free to reopen if problem still persists.
Comment 11 Robin Bankhead 2011-12-14 14:02:48 UTC
Sorry, didn't see previous request for info. I've checked now and the UA as you said no longer has any locale included.  The DOM property navigator.language = "en-GB" and the HTTP header is Accept-Language	en-gb,en;q=0.5.

This is with me having set the locale property manually to the chrome uri as directed above, mind you.
Comment 12 Robin Bankhead 2011-12-14 14:11:51 UTC
Òh, please disregard the above. Forgot I'm using firefox-bin now, so the observations are not germane. If I'm in a position to go back to the src build at some point I'll update this.