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 updated the task description. (Show Details)
Chmarkine raised the priority of this task from to Needs Triage.
Chmarkine claimed this task.
Chmarkine added subscribers: Chmarkine, liangent.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptFeb 28 2015, 2:37 AM
Chmarkine updated the task description. (Show Details)Feb 28 2015, 2:38 AM
Chmarkine set Security to None.
Aklapper triaged this task as Low priority.Mar 2 2015, 8:43 AM

Since this patch is abandoned, decline?

Chmarkine closed this task as Resolved.Apr 8 2019, 10:45 PM
Chmarkine removed Chmarkine as the assignee of this task.
Chmarkine removed a subscriber: Chmarkine.