localizationinternationalizationchinese-locale

What is the typical Chinese language code for the Accept-Language header?


Unfortunately, I have no way to check this personally, so I wanted to ask the community about it.

According to RFC 5646, Chinese can have the following representation: zh-Hans for Simplified Chinese, zh-Hant for Traditional Chinese, or more specific: zh-Hans-SG for Simplified Chinese for Singapore, zh-Hant-MO for Traditional Chinese for Macau. This is not an exhaustive set of options, there are many.

One thing I know for sure - Chinese cannot be represented as follows: zh, or zh-CN, or zh-TW and the like.

However, how are things in reality? If the site is visited by a user who speaks Chinese, what can I expect in the Accept-Language header?


Solution

  • Well, I got the Windows Sandbox installed and I was able to install whatever I wanted there.

    I checked two browsers:

    1. QQ browser (Chinese is selected by default, I'm not sure which script).
    2. Google Chrome (added all supported Chinese languages ​​and made them first on the list).

    QQ sends in the request the following content in the accept-language header: zh-CN, zh; q = 0.9.

    Google Chrome sends the following content in the accept-language header: zh-CN, zh-TW; q = 0.9, zh-HK; q = 0.8, zh; q = 0.7, en; q = 0.6, also I figured out what Chrome means under the indicated codes:

    To be honest, this is strange, but it is a fact.