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

Issue 668697 link

Starred by 3 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment

Provide a developer option for changing the accepted languages

Reported by mbre...@gmail.com, Nov 25 2016

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.98 Safari/537.36

Steps to reproduce the problem:
1. open chrome with `tmp=`date +%Y%m%d%H%M%S`;open -na "Google Chrome" --args --user-data-dir=/tmp/$tmp --no-first-run --disable-extensions --safe-plugins --disable-default-apps --disable-save-password-bubble --disable-session-storage --disable-sync --disable-zero-browsers-open-for-tests --lang=se`
2. Check `navigator.language`

What is the expected behavior?
Expect navigator.language to be "se"

What went wrong?
navigator.language tis set to system default

Did this work before? N/A 

Does this work in other browsers? N/A

Chrome version: 54.0.2840.98  Channel: stable
OS Version: OS X 10.12.1
Flash Version: Shockwave Flash 23.0 r0

This is useful for testing a site in different languages/locales
 

Comment 1 by peter@chromium.org, Nov 25 2016

Cc: pfeldman@chromium.org
Components: Platform>DevTools
Labels: -OS-Mac OS-All
Status: Available (was: Unconfirmed)
Summary: Provide a developer option for changing the accepted languages (was: CLI switch should set browser langugage)
I'm slightly rephrasing the title.

In short -- give developers a way to change the values given in the `navigator.language(s)` attributes and the `Accept-Language` HTTP header for testing the internationalization behaviour of their websites.

Pavel, do you think this would be a fit for DevTools?
Owner: eostroukhov@chromium.org
Status: Assigned (was: Available)
I think so, this looks like sensors and UA emulation, would fit that feature set perfectly.

Comment 3 by l...@chromium.org, Jun 26 2018

Owner: l...@chromium.org
Cc: -pfeldman@chromium.org julialiang@chromium.org
Julia@, here's an initial UX screenshot fyi:
https://imgur.com/a/x9VoAe8

Side note: I believe we used to have an "Emulation" drawer, which had controls found in today's "Sensors" and "Network conditions".  "Network conditions" drawer may not be super ideal, but we can add it when users type "language" into the Command Menu at least.
Cc: kayce@chromium.org
We plan to polish the UX more with autocomplete, clearer placeholder text, and a link to documentation could be nice here.  Given the placement and behavior, this feature might not be super-widely used, but very useful in specific scenarios.

kayce@, would it be reasonable to have a "Learn more" link to documentation that explains this new section?

If possible, an article could convey:
- a custom value will override 'navigator.language'
- a custom value will be attached as an 'Accept-Language' header to network requests
- list / examples of possible language codes
- the value of testing/localizing sites in different users' preferred languages

https://developer.mozilla.org/en-US/docs/Web/API/NavigatorLanguage/language
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language

Sign in to add a comment