i am testing pseudo-localization of a web-site.
i can configure Internet Explorer to have custom accept languages:
- Click Tools, Internet Options
- On the General tab click Languages
- In the Language Preferences dialog click Add.
- Enter a user-defined language of
qps-ploc
(i.e. the Pseudo (Base) locale) - Click OK
![](https://www.eimg.top/images/2020/03/02/58c1fa14a3afcff402bf08672842fed5.png)
Now when Internet Explorer issues an http request, the accept languages will lead with qpc-ploc
:
GET https://stackoverflow.com/ HTTP/1.1
Accept: application/x-ms-application, image/jpeg, application/xaml+xml, image/gif, image/pjpeg, application/x-ms-xbap, */*
Accept-Language: qps-ploc,en-US;q=0.5
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.3; .NET4.0C; .NET4.0E)
Accept-Encoding: gzip, deflate
Connection: Keep-Alive
Host: stackoverflow.com
How do i perform the same change to Chrome? To Firefox?
Update
It should also be noted that Internet Explorer honors my Windows preferences. My Windows is configured to use Pseudo (Base) qps-ploc
locale. By default Internet Explorer uses it.
Google Chrome ignores my Windows preferences, deciding instead to request en-US
and en
language:
GET https://stackoverflow.com/ HTTP/1.1
Host: stackoverflow.com
Connection: keep-alive
Cache-Control: max-age=0
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.220 Safari/535.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
In Firefox
Use about:config
![](https://www.eimg.top/images/2020/03/02/f4152fd9a7da357fe64d7c64cdbf68f7.jpg)
![](https://www.eimg.top/images/2020/03/02/652c4ccbbaa4f7e637f40953ab44adc3.jpg)
(There is a typo in qps-ploc in the screenshots, but you surely get the idea)
In Chrome
(Edit: refer to the comments for ways to avoid Chrome override the setting in new versions.)
Edit the file C:\Users\USERNAME\AppData\Local\Google\Chrome\User Data\Default\Preferences
, and add:
{ ...
"intl": {
"accept_languages": "qps-ploc,en-us,en"
},
...
}
For example:
![](https://www.eimg.top/images/2020/03/02/8db251273389b26209bcc372bfb426fd.jpg)
![](https://www.eimg.top/images/2020/03/02/f683518e36d5c3936cf3f41aa56d9a01.jpg)
You can also set this via the settings page.
Go to settings (cmd + , on mac, probably cntrl + , on windows) and search for language. Click the "manage languages" link and add your preferred language. After that just drag your language to the top of the list and you're done!
![](https://www.eimg.top/images/2020/03/02/76b3f64f5174af68ee5a4d28d1ad6009.png)
Or direct access to languages settings: chrome://settings/languages
![](https://www.eimg.top/images/2020/03/02/3f88be83426a79dc6625a24b8c3dc6ab.png)
来源:https://stackoverflow.com/questions/7769061/how-to-add-custom-accept-languages-to-chrome-for-pseudolocalization-testing