Page MenuHomePhabricator

Chinese language converter doesn't recognize Accept-Language: zh-Hans-CN
Closed, ResolvedPublic

Description

Currently, Chinese language converter only supports these language codes: zh, zh-hans, zh-hant, zh-cn, zh-sg, zh-my, zh-hk, zh-mo, and zh-tw. The Accept-Language header field sent by IE 11 on Windows 8.1 is something like:

Accept-Language: en-US,en;q=0.8,zh-Hans-CN;q=0.7,zh-Hans;q=0.5,zh-Hant-TW;q=0.3,zh-Hant;q=0.2

The result is that MediaWiki doesn't recognize zh-Hans-CN, so zh-Hans is used, which is less desirable than zh-cn. Also according to RFC 5646 Section 4.6, zh-Hans-CN is preferred over zh-cn.

A tag such as "zh-Hans-XQ" conveys a great deal of
public, interchangeable information about the language 
material (that it is Chinese in the simplified Chinese 
script and is suitable for some geographic region 'XQ').

So I propose to add zh-hans-cn to variantfallbacks array in LanguageZh.php.
Patch: https://gerrit.wikimedia.org/r/#/c/193549/

Event Timeline

Chmarkine claimed this task.
Chmarkine raised the priority of this task from to Needs Triage.
Chmarkine updated the task description. (Show Details)
Chmarkine added subscribers: Chmarkine, liangent.
Chmarkine set Security to None.

Since this patch is abandoned, decline?

Chmarkine removed Chmarkine as the assignee of this task.
Chmarkine unsubscribed.