After mentioning an issue with localized content on the blog ( https://blog.torproject.org/comment/269161#comment-269161) I investigated a bit and it seems changes to intl.accept_languages get overwritten after restarting Tor Browser by our custom values. Other preferences might be affected as well.
does not give us back the intl.accept_languages value which is in chrome://global/locale/intl.properties (in case one has a non-en-US bundle) but en-US, en. It's not clear yet where that new value is coming from.
How can I reproduce this bug? I tried toggling extensions.torbutton.spoof_english within 7.0.1 on OSX, and intl.accept_languages was correctly updated.
How can I reproduce this bug? I tried toggling extensions.torbutton.spoof_english within 7.0.1 on OSX, and intl.accept_languages was correctly updated.
It gets correctly updated, yes, but after a restart that is gone again which should not happen and is not happening in the 6.5.x series. I tested that with Arthur's patch in #21999 (moved) but it is not related to it.
So far I cannot reproduce this problem when testing on OSX without the patch for #21999 (moved). Here is what I did:
Opened a clean copy of the es-ES variant of Tor Browser 7.0.1 (no preexisting TorBrowser-Data directory).
Clicked Conectar during startup.
Opened about:config and noted that the value for intl.accept_languages was en-US, en as expected.
Used about:config to toggle extensions.torbutton.spoof_english to false and noted that the intl.accept_languages value had been changed to es-ES, es, en-US, en (the default value).
Restarted the browser and checked the intl.accept_languages one more time. The value was still es-ES, es, en-US, en.
So far I cannot reproduce this problem when testing on OSX without the patch for #21999 (moved). Here is what I did:
Opened a clean copy of the es-ES variant of Tor Browser 7.0.1 (no preexisting TorBrowser-Data directory).
Clicked Conectar during startup.
Opened about:config and noted that the value for intl.accept_languages was en-US, en as expected.
Used about:config to toggle extensions.torbutton.spoof_english to false and noted that the intl.accept_languages value had been changed to es-ES, es, en-US, en (the default value).
Restarted the browser and checked the intl.accept_languages one more time. The value was still es-ES, es, en-US, en.
I followed those five steps and I get en-US, en as result. Could you test on a Linux box (I did that)? Maybe that's the difference (although this would be even weirder)...
Querying chrome://global/locale/intl.properties at the beginning of torbutton_update_fingerprinting_prefs() gives me en-US, en after restart for intl.accept_languages while entering chrome://global/locale/intl.properties into the URL bar gives me de, en-US, en as it should be the case. Huh.
Kathy and I can reproduce the problem on Linux (but still not on OSX). The incorrect value definitely comes from the en-US file (toolkit/locales/en-US/chrome/global/intl.properties). We confirmed that by changing the value there to en-US, en, fr and seeing that when this bug occurs the "default" value is indeed en-US, en, fr. Your comment:7 experiment is interesting. From the URL bar, you saw the correct data but somehow the prefs system seems to be ignoring the language pack and consulting the en-US intl.properties file. The mystery is why. The general.useragent.locale pref does not seem to be suffer from the same bug even though its value should be determined by the same mechanism.
But isn't that bug about the literal value chrome://global/locale/intl.properties showing up (as a string)? I think this ticket covers a different but possibly related problem.
An update on that one: It seems there are different issues here at work. The one is that the intl.accept_languages pref is not correctly updated/shown and the other one is that the wrong header values are sent.
Surprisingly, those issues don't belong together. I.e. the first one is fixed with Tor Browser 7.5a8, more exactly with the TorLauncher 0.2.14.1 update. The other one is unaffected by it. https://bugzilla.mozilla.org/show_bug.cgi?id=1005640 fixed a pretty similar problem for Firefox (it landed in version 55). I guess a next step would be to backport that patch and look whether we are good on ESR 52 as well.
FWIW, it does not fix the issue on the blog, though. But I think this is okay for us as we can provide a reliable and supported method of achieving the same goal as the user tried to reach with the customization. I bet the underlying issue is another corner case regarding to language packs Mozilla has not fixed yet.