To reproduce:
- Define Chinese as an Accept-Language in your browser.
- Enable the Content Translation beta feature in the Chinese Wikipedia
- Open https://zh.wikipedia.org/wiki/ASCII
Observed: Gray interlanguage link to "中文" appears on top of the interlanguage links list.
Expected: "中文" is Chinese itself, so it must not appear there.
I debugged this a bit, and found that the reason for it is that we are filtering out wgPageContentLanguage, and for languages with variants it's not equal to the primary language code. For Chinese, the primary language code is "zh", but wgPageContentLanguage is "zh-hant", "zh-hk", "zh-hans", etc.
We need to use something other than wgPageContentLanguage or to cut the suffix from these languages—zh, sr, ku, uz, tg, ug.
Reported at https://www.mediawiki.org/wiki/Topic:T4bamtsslf4y1b0y
High prio because it affects several major languages.
See also: T116401