New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 699094 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: ----



Sign in to add a comment

accept-language does not match system language(s)

Project Member Reported by stevewalker@google.com, Mar 7 2017

Issue description

Device name: Pixel

From "Settings > About Chrome"
Application version: 56
Operating system: 7.1.1

Steps to reproduce:
(0) Have Android system language be English.
(1) Set Android system language to Japanese.
(2) Open Chrome to reddit.com. Request the desktop site. The page should contain Japanese text.
(3) Return to system settings and change the language back to English. Remove Japanese from the Language preferences list completely.
(4) Reopen Chrome. The language will now be English in the settings again.
(5) Navigate back to reddit.com. Request desktop site again.

Expected result: The site reddit.com loads completely in English.


Actual result: The site reddit.com contains Japanese text exactly how it looked in step (2). Inspecting the initial HTTP request in Chrome developer tools shows that in the request headers, ja-JP is the first language under accept-language. 

Japanese should not be listed as an accept-language once it has been removed from Language preferences in the Android settings.

Additional information: I've ensured that Japanese has been completely removed from my Android system languages list, and is not present in my Gboard languages list or my Google account languages. I've tried deleting all Chrome data from the beginning of time inside Chrome and deleting all application data via the Android apps settings. Restarting Android before and/or after wiping the data and changing the language back to English also had no effect.

Uninstalling all updates reverts Chrome back to 53 on my Pixel and solves the issue. Upgrading back to Chrome 56 via the play store immediately makes the bug present again. Running the Chrome beta app at 57 also presents this bug.

I have successfully reproduced this on a Nexus 5X running Android 7.1.2 with Chrome 56 as well. I originally tried reproducing with Chrome 55 on the Nexus 5X and could not reproduce after several tries. After upgrading to 56 via the play store I was able to repro on my first attempt. This combined with reverting back to 53 on my Pixel leads me to believe this bug was introduced with the 56 release.




 

Comment 1 by mef@chromium.org, Mar 7 2017

Components: UI>Browser
chrome_http_user_agent_settings.cc includes provisions to update Accept-Languages value when user preferences change, but I don't know whether it is used on Android: https://cs.chromium.org/chromium/src/chrome/browser/net/chrome_http_user_agent_settings.cc


Cc: prashanthpola@chromium.org
Components: Blink>JavaScript>Internationalization
Labels: triage-te
Cc: -prashanthpola@chromium.org tedc...@chromium.org
Status: Available (was: Unconfirmed)
We are not able to repro this issue on Chrome Stable:56.0.2924.87,55.0.2883.91 Chrome Beta:57.0.2987.88 Device:Nexus 5X/N2G47H
Cc: bauerb@chromium.org torne@chromium.org nona@chromium.org
Labels: -triage-te
This issue looks similar to 
https://bugs.chromium.org/p/chromium/issues/detail?id=593515
https://bugs.chromium.org/p/chromium/issues/detail?id=369897

CC'ing devs from  issue 593515 

Comment 5 by torne@chromium.org, Mar 8 2017

Chrome is expected to restart when the system locales change, which will cause it to read the configuration afresh. See  issue 35049  for the background there. If that's not happening, that's a regression. If it doesn't pick up the right config after the restart, that's also a regression.
Cc: twelling...@chromium.org groby@chromium.org
+groby - Do you know how accept-language is generated?

I did a quick glance through the code and the only place I see it updated is in translate code:
https://cs.chromium.org/chromium/src/components/translate/core/browser/translate_prefs.cc?q=translate_prefs+package:%5Echromium$&l=409

Comment 7 by nona@chromium.org, Mar 8 2017

Weird, yeah I confirmed that this issue available on M56, ja-JP is listed to the first place even if the Japanese is listed in the 2nd place in system language.


Comment 8 by nona@chromium.org, Mar 8 2017

> #6

First, there are two source of accept-languages, the default accept-languages coming from resources, and the system language preference.

They are merged in pref_service_bridge.cc.

https://cs.chromium.org/chromium/src/chrome/browser/android/preferences/pref_service_bridge.cc?rcl=163d7ed981d080347b05a6ad4d47d0e2418f04e9&l=1088

then finally, fallback language is appended in a platform neutral way in net/http_util.cc

https://cs.chromium.org/chromium/src/net/http/http_util.cc?rcl=163d7ed981d080347b05a6ad4d47d0e2418f04e9&l=737

Comment 9 by nona@chromium.org, Mar 8 2017

Looks like this is no longer available on ToT.

I just checked out and tested on the ToT Chrome with Android N and the accept-langauge is
en-US,ja-JP;q=0.8,ja;q=0.6,en;q=0.4

The fallback order may be still weird but server should use en-US as the first priority.
I wonder if the reason is https://chromiumcodereview.appspot.com/23923007

If I read this right, it adds a language to the language list when it's been marked for "never translate". 

That's... an interesting but understandable choice. That said, this should only happen when you click "never translate". And it certainly doesn't persist if you wipe out your settings. (I don't know what OP meant by 'wiping Chrome data' - if it includes wiping preferences, this shouldn't be the cause)

Comment 11 by nona@chromium.org, Mar 8 2017

Oh translate may change the accept-language, I didn't know that.

Yeah, so there are three sources, default accept-languages, system languages and languages not to be translated.

My feeling is something like that translate should aware of system languages and don't offer translate to the language listed in system languages.
All,

Thanks for investigating this so quickly.

> #10

I don't recall clicking "never translate" but I might have and just not noticed. However, performing "reset translate settings" does not solve the issue.

By wiping Chrome data, I meant I tried "clear data" from "Clear browsing data" inside Chrome as well as Settings > Apps > Chrome > Storage > Manage Space > Clear All Data from the Android settings.
Labels: Hotlist-LanguageSettings
This is interesting. Can you check on desktop what your language preferences are in chrome://settings/languages? I tried a variation of this on my device (using Russian and English instead of Japanese and English) and noticed that my accept_language prefs from desktop seemed to be overriding my locale (e.g. when I'd change my Android locale to Russian I'd still get the English reddit.com site).
Something is definitely weird with the settings.

When I reproduced this on the second device, that account did have Japanese listed under settings/languages on desktop. I don't believe removing it from the language settings solved the issue as it persisted for multiple days on my Android device after I did so. Updating my system languages in Android after removing from settings/languages on desktop finally resolved the issue on this device.

Back to the first account & device this occurred with: Japanese was not listed under settings/languages on desktop last time I checked. I'll double check later today when I can get access to that desktop that has this account signed in. However, I've found a workaround the bug on Android. From a fresh Chrome install, I unchecked sync settings. Everything behaves as normal, only getting English. Re-enabling the syncing of settings causes pages to return back to Japanese. This account must have Japanese in it's settings. If it's not showing up in settings/languages on desktop that's a separate issue since it did show up for the second account.

To go back to English I unchecked sync settings again. This must be stored on disk somewhere? since a reboot was not sufficient. I needed to change my Android system languages for Chrome to refresh it's languages, mimicking the behavior above with the second account.
Cc: napper@chromium.org yyushkina@chromium.org
Components: -UI>Browser UI>Browser>Language
Cc: claudiomagni@chromium.org
Project Member

Comment 18 by sheriffbot@chromium.org, Jul 26 2017

Labels: Hotlist-Google
Owner: goog...@chromium.org
Assigning this to Leo who is experienced in Android.
I am composing a setting page for Clank users to update their accepted languages, and this bug should be fixed after that.
Status: Fixed (was: Available)
Fixed with the addition of language settings controls to Chrome on Android in M65.

Sign in to add a comment