Summary: | <=mozilla-firefox-3.6-r2 user-agent string ignores LINGUAS="en_GB" | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Robin Bankhead <gentoo> |
Component: | New packages | Assignee: | Mozilla Gentoo Team <mozilla> |
Status: | RESOLVED NEEDINFO | ||
Severity: | normal | ||
Priority: | High | ||
Version: | 10.0 | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 336136 |
Description
Robin Bankhead
2010-02-15 12:13:46 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 Ì'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. 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" 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. Thank you for the info I was able to successfully change my locale via your suggestion. 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. try setting pref("general.useragent.locale", "chrome://global/locale/intl.properties"); and let me know. (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. Are you still seeing this with firefox-7.0.1-r1? Over a month with no input from user, feel free to reopen if problem still persists. 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. Ò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. |