如何将自定义接受语言添加到 Chrome 以进行伪本地化测试? [英] How to add custom Accept-Languages to Chrome for pseudolocalization testing?

本文介绍了如何将自定义接受语言添加到 Chrome 以进行伪本地化测试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在测试 伪本地化 一个网站.

i am testing pseudo-localization of a web-site.

我可以将 Internet Explorer 配置为自定义接受语言:

i can configure Internet Explorer to have custom accept languages:

  1. 点击工具Internet选项
  2. 常规标签上点击语言
  3. 语言首选项对话框中点击添加.
  4. 输入用户定义的 qps-ploc 语言(即伪(基本)语言环境)
  5. 点击确定
  1. Click Tools, Internet Options
  2. On the General tab click Languages
  3. In the Language Preferences dialog click Add.
  4. Enter a user-defined language of qps-ploc (i.e. the Pseudo (Base) locale)
  5. Click OK

现在,当 Internet Explorer 发出 http 请求时,接受语言将以 qpc-ploc 开头:

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

如何对 Chrome 执行相同的更改?火狐?

How do i perform the same change to Chrome? To Firefox?

更新

还应注意,Internet Explorer 尊重我的 Windows 偏好.我的 Windows 配置为使用 Pseudo (Base) qps-ploc 语言环境.默认情况下,Internet Explorer 使用它.

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.

谷歌浏览器忽略我的 Windows 偏好,决定改为请求 en-USen 语言:

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

推荐答案

在 Firefox 中

使用about:config

(截图中的qps-ploc有错别字,但你肯定明白)

(There is a typo in qps-ploc in the screenshots, but you surely get the idea)

(编辑:请参阅评论以了解避免 Chrome 在新版本中覆盖该设置的方法.)

(Edit: refer to the comments for ways to avoid Chrome override the setting in new versions.)

编辑文件C:UsersUSERNAMEAppDataLocalGoogleChromeUser DataDefaultPreferences,并添加:

{ ...

   "intl": {
      "accept_languages": "qps-ploc,en-us,en"
   },

   ...
}

例如:

这篇关于如何将自定义接受语言添加到 Chrome 以进行伪本地化测试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆