Closed Bug 771999 Opened 12 years ago Closed 8 years ago

Switching locale at runtime doesn't update Accept-Language HTTP header

Categories

(Core :: Networking: HTTP, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1005640

People

(Reporter: azdi, Unassigned)

References

Details

(Whiteboard: [necko-backlog])

Attachments

(4 files)

Attached image FF.png
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.5) Gecko/20110328 Firefox/10.0.5
Build ID: 20120621112317

Steps to reproduce:

1. Install firefox and firefox-ru linux packages (also works with other langpacks and FF versions)
2. Run firefox
3. Navigate to http://browserspy.dk/language.php
4. Doesn't see "ru" in Accepted Languages field.
5. Close and rerun FF.
6. Navigate to http://browserspy.dk/language.php
7. All OK, see "ru" in Accepted Languages field.
8. Remove user profile (rm -rf ~/.mozilla)
9. Repeat steps 2-7.


Actual results:

Localization language doesn't appear in "Accepted Languages" HTTP header at FF first run.


Expected results:

Localization language must be appeared in "Accepted Languages" HTTP header at FF first run.
Ivan, I tried this with Firefox 10, Firefox 14.0b11 (latest beta), and Firefox Nightly, and I am not able to reproduce the problem. Every time I visit the URL you provided I see "ru-ru" and "ru;q=0.8" in the list of Accepted Languages, and I see them as options in the language preferences in Firefox.

However, they way I installed them was by visiting the Mozilla site and downloading them from there and installing them on my desktop.

I tried installing the Firefox Russian language pack, but I haven't been able to activate it on Ubuntu.
Component: Untriaged → Preferences
(In reply to juan becerra [:juanb] from comment #1)
> Ivan, I tried this with Firefox 10, Firefox 14.0b11 (latest beta), and
> Firefox Nightly, and I am not able to reproduce the problem. Every time I
> visit the URL you provided I see "ru-ru" and "ru;q=0.8" in the list of
> Accepted Languages, and I see them as options in the language preferences in
> Firefox.
> 
> However, they way I installed them was by visiting the Mozilla site and
> downloading them from there and installing them on my desktop.
> 
> I tried installing the Firefox Russian language pack, but I haven't been
> able to activate it on Ubuntu.

Do you clear your Mozilla profile every start? Or you try this with Win versions?

Try to do this in Console:
rm -rf ~/.mozilla
LANG=ru_RU.UTF-8 LC_ALL=ru_RU.UTF-8 firefox
Attached image Screen #1
Attached image Screen #2
Attached image Screen #3
Ubuntu 12.04 live cd
Yet another 1-3 screenshots
Does this bug only happen with the Ubuntu packaged version of Firefox? If so, this should be filed in their Launchpad system.
Summary: Accepted Languages → Localization language doesn't appear in "Accepted Languages" HTTP header at first run
(In reply to Anthony Hughes, Mozilla QA (irc: ashughes) from comment #7)
> Does this bug only happen with the Ubuntu packaged version of Firefox? If
> so, this should be filed in their Launchpad system.

No, primary I use other, rpm-based distro.
This bug appears since ~5 version of FF (first time appears 2011-08-19 in our distro bugzilla). They has only one simple patch of context menu relatively original FF sources.

This situation also seen, when FF packages updated (without cleaning profile)
Regardless, I don't see any evidence of this happening for you with a version downloaded from OUR ftp server. You've only indicated this so far with a distro packaged version. Please provide some evidence of this occurring with one of our official builds. Otherwise, I suggest filing a bug with your respective distribution.
(In reply to Anthony Hughes, Mozilla QA (irc: ashughes) from comment #9)
> Regardless, I don't see any evidence of this happening for you with a
> version downloaded from OUR ftp server. You've only indicated this so far
> with a distro packaged version. Please provide some evidence of this
> occurring with one of our official builds. Otherwise, I suggest filing a bug
> with your respective distribution.

Official distribution has a built-in language pack and have no this problem.
I also checked Fedora, SuSE and CentOS LiveCDs - all they have this problem.
Is there an official distribution with separate language pack?
So when you install the distribution to your hard drive with the distribution's built-in language pack this bug does not reproduce. However, running directly off the Live CD reproduces this bug?

If that's correct, I don't see how this is a bug in Mozilla's official Firefox builds. Considering you can reproduce in Fedora and CentOS live CDs, I would start with bugzilla.redhat.com.

I'm going to mark this bug RESOLVED INVALID. Please reopen if you can show this is a problem with the builds we provide from ftp.mozilla.org. 

Thank you for taking the time on this.
Status: UNCONFIRMED → RESOLVED
Closed: 12 years ago
Resolution: --- → INVALID
(In reply to Anthony Hughes, Mozilla QA (irc: ashughes) from comment #11)
> So when you install the distribution to your hard drive with the
> distribution's built-in language pack this bug does not reproduce. However,
> running directly off the Live CD reproduces this bug?
No, bug reproduce in all cases. Bug doesn't reproduce, if I install FF using binary tar.bz2 package from mozilla.com. But if I use distribution package - it reproduce in all cases.

If you want, I can record some videos with examples in different distributions.
Status: RESOLVED → UNCONFIRMED
Resolution: INVALID → ---
(In reply to Ivan Ovcherenko from comment #12)
> Bug doesn't reproduce, if I install FF using binary tar.bz2 package
> from mozilla.com. But if I use distribution package - it reproduce in all cases.

I'm not sure there is anything we can do for bugs introduced by Linux distribution packaging. I would suggest filing a companion bug with those distributions which reproduce this bug.
Version: 10 Branch → Trunk
Confirming this with the following steps to reproduce:

1. Install the English (en-US) Firefox 16.0.0, create a new profile, set general.useragent.locale to 'de'.
2. Install the German language pack (de.xpi): ftp://ftp.mozilla.org/pub/firefox/releases/16.0/win32/xpi/
3. Close Firefox and start it again. The UI should now be in German. The accept headers list German.
4. Launch the profile with Firefox 16.0.1 (en-US), install it if necessary.

Actual result:
The UI is German, but accept headers are the default English ones.

Expected result:
The accept headers remain with preference for German.

The bug reports started after the language packs' compatibility got bound to branches and not anymore to releases, so it's likely that the issue didn't come to surface before.

So I tested with Firefox 3.6.27 > 3.6.28 and there is no issue.
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Linux → All
Hardware: x86_64 → All
Summary: Localization language doesn't appear in "Accepted Languages" HTTP header at first run → Localization language doesn't appear in "Accepted Languages" HTTP header at first run after installing or updating Firefox with active language packs
This seems to be a regression in between Firefox 15 and 16. I tried to reproduce this using Firefox 15.0 and 15.0.1, but I get the German accept headers in the newer version.
OS: Ubuntu 12.10 x86

Steps:
1. Install Firefox 15.0 en_US version
2. Set general.useragent.locale to 'de'
3. Install the German language pack (de.xpi) from ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/15.0/linux-i686/xpi/de.xpi and restart
=> German UI and response headers
4. Install Firefox 15.0.1 en-US and start with the same profile
Result: UI and accept headers have the language de-de.
nsHttpHandler::PrefsChanged doesn't listen for changes to the selected locale, so if we're switching locales at runtime, it doesn't update the acceptlang header.

I'm not sure that the chrome registry or addons manager supports all kinds of notifications necessary to implement this right, though.

Say, you're switching your locale to German on an en-US build. Prefservice sends out a notification, and you're still getting en-US accept lang. Then you're installing a German langpack. Chrome registry doesn't tell you things ;-) , but now you'd like to switch accept-lang.

Another scenario, we're using matchos on linux, and switch OS locale. I doubt we get any notification on that.

I'm wondering if we should just refresh the value from the pref every other request, or cache it for just some timeframe. I guess it wouldn't hurt us much if we just cached the value for a minute instead of forever.

Moving to network, anyhow.

I don't think this is a regression, but we're triggering it in more cases now that langpacks install restartless.
Component: Preferences → Networking: HTTP
Keywords: regression
Product: Firefox → Core
Summary: Localization language doesn't appear in "Accepted Languages" HTTP header at first run after installing or updating Firefox with active language packs → Switching locale at runtime doesn't update Accept-Language HTTP header
Pike: You didn't hijack this bug, did you? This bug was about the accept-language http header not using the one set for the language after _launching_ Firefox after an application update.
The initial comment sounds like this is fixed by a restart. I don't see any mention about software update there.

Note, language packs are still compatible by version, not by branches, by all I can tell.
Yes, the issue goes away with the second start after installing/updating Firefox. The bug filer also mentions that Firefox and the language pack got installed and later launched, so the language pack hadn't been installed at runtime.

The language packs are branch-compatible since Firefox 15 (bug 723135).
Whiteboard: [necko-backlog]
Status: NEW → RESOLVED
Closed: 12 years ago8 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: