Page MenuHomePhabricator

Variants have disappeared from language switcher
Closed, ResolvedPublic

Description

Visit https://zh.m.wikipedia.org/wiki/%E6%95%85%E5%8F%8B%E9%87%8D%E9%80%A2
When I click the language button I expect to see variants for this language as in the desktop site I see this:

Yet in the language overlay I see this:

Previously we showed this: http://imgur.com/Fwel4vW

I suspect we are incorrectly excluding the current language.
This may explain why we are seeing a drop in engagement in the new overlay. Variants are important.

Details

Related Gerrit Patches:
mediawiki/extensions/MobileFrontend : masterAdd variants to the list of preferred languages
mediawiki/extensions/MobileFrontend : wmf/1.27.0-wmf.18Revert "Promote structured language overlay to stable"

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 23 2016, 11:34 PM

Looking at the code the new LanguageOverlay completely ignores the variants option passed to it returned to it by getPageLanguages

Suggested priority: unbreak now

{"languages":[{"lang":"da","url":"https://da.wikipedia.org/wiki/Meet_Kevin_Johnson","title":"Meet Kevin Johnson","langname":"dansk"},{"lang":"en","url":"https://en.wikipedia.org/wiki/Meet_Kevin_Johnson","title":"Meet Kevin Johnson","langname":"English"},{"lang":"es","url":"https://es.wikipedia.org/wiki/Meet_Kevin_Johnson","title":"Meet Kevin Johnson","langname":"español"},{"lang":"hu","url":"https://hu.wikipedia.org/wiki/Bemutatom_Kevin_Johnsont_(Lost)","title":"Bemutatom Kevin Johnsont (Lost)","langname":"magyar"},{"lang":"ro","url":"https://ro.wikipedia.org/wiki/Meet_Kevin_Johnson_(Lost)","title":"Meet Kevin Johnson (Lost)","langname":"română"},{"lang":"ru","url":"https://ru.wikipedia.org/wiki/%D0%97%D0%BD%D0%B0%D0%BA%D0%BE%D0%BC%D1%8C%D1…_%D0%9A%D0%B5%D0%B2%D0%B8%D0%BD_%D0%94%D0%B6%D0%BE%D0%BD%D1%81%D0%BE%D0%BD","title":"Знакомьтесь — Кевин Джонсон","langname":"русский"},{"lang":"tr","url":"https://tr.wikipedia.org/wiki/Meet_Kevin_Johnson","title":"Meet Kevin Johnson","langname":"Türkçe"}],"variants":[{"langname":"不转换","lang":"zh","url":"/zh/故友重逢"},{"langname":"简体","lang":"zh-hans","url":"/zh-hans/故友重逢"},{"langname":"繁體","lang":"zh-hant","url":"/zh-hant/故友重逢"},{"langname":"大陆简体","lang":"zh-cn","url":"/zh-cn/故友重逢"},{"langname":"香港繁體","lang":"zh-hk","url":"/zh-hk/故友重逢"},{"langname":"澳門繁體","lang":"zh-mo","url":"/zh-mo/故友重逢"},{"langname":"马新简体","lang":"zh-sg","url":"/zh-sg/故友重逢"},{"langname":"台灣正體","lang":"zh-tw","url":"/zh-tw/故友重逢"}]}

It's weird because sometimes variants are already in the list of languages, cases with 'be' and 'zh' come to mind. I wonder why the data structure separates them into two anyway. During my tests the variants never were returned by the API thus I ignored them.

Yeh our implementation of variants is very strange but any Chinese page should have variants automatically.

To get variants working you'll need to set the default language of your wiki to zh to get them back from the API. Uselang will not work.

OK, so this seems to be blocked on API not providing the article title in variants. Should we just display the language link without the article title for each variant? Should we improve the API to return the article title?

Jdlrobson updated the task description. (Show Details)Mar 24 2016, 7:13 PM

Change 279429 had a related patch set uploaded (by Jdlrobson):
Revert "Promote structured language overlay to stable"

https://gerrit.wikimedia.org/r/279429

I spoke to Baha and Adam, and we decided to revert the pushing the new language overlay to stable card in the deployment branch.

We'll aim to fix this issue for the next train. Let's re-evaluate Monday and Tuesday (day before it rolls out to variant Wikipedia's) whether we need to revert from master but hopefully we can rectify this promptly.

@Nirzar, @bmansurov and @dr0ptp4kt will talk about any design changes needed.

Change 279429 merged by jenkins-bot:
Revert "Promote structured language overlay to stable"

https://gerrit.wikimedia.org/r/279429

Here's how the list unit should look when the API does not return the title of the article for a language or a language variant

Change 279644 had a related patch set uploaded (by Bmansurov):
Add variants to the list of preferred languages

https://gerrit.wikimedia.org/r/279644

FYI now I see it, it seems wrong that we show all the variants as preferred languages... possibly even confusing. I ran this by my partner (Chinese speaker) and she said it didn't make sense to her (there's Hong Kong Chinese, Singaporean Chinese, Macau Chinese etc..). The list for Chinese is overwhelming and if you're only a Hong Kong chinese speaker I would suggest this reduces its usefulness:

I think it's okay as an interim solution but we should definitely look to improve this.
I'd suggest pulling in a native chinese speaker maybe @Liuxinyu970226 to give advice.

Also @Shizhao :)
Background: We are revamping the language selecting on Wikipedia (see http://reading-web-staging.wmflabs.org/wiki/Lang?mobileaction=beta) and are having trouble knowing what best to do with the available variants. We would welcome some thoughts on this design which always puts them in a section at the top => https://phabricator.wikimedia.org/T130798#2151967

Jdlrobson, thanks. That's one use case. As for me I'd like to see both Uzbek Cyrillic and Uzbek Latin versions up top because they are tightly related. If we ask users about their opinion we should ask Non-Chinese language users too. Otherwise we'd be optimizing for Chinese only.

Also @Shizhao :)
Background: We are revamping the language selecting on Wikipedia (see http://reading-web-staging.wmflabs.org/wiki/Lang?mobileaction=beta) and are having trouble knowing what best to do with the available variants. We would welcome some thoughts on this design which always puts them in a section at the top => https://phabricator.wikimedia.org/T130798#2151967

And why not @liangent @jimmyxu and @Cwek

And the last screenshot... Perhaps we can have a script to suppress "ZH 不转换"?

Jdlrobson added a subscriber: Nikerabbit.

And the last screenshot... Perhaps we can have a script to suppress "ZH 不转换"?

If I understand that correctly it says unchangeable? So we shouldn't show any variants in this case. I wonder why this shows at all...! @Amire80 @Nikerabbit do you know why this is showing up and if we can programmatically supress this?

Change 279644 merged by jenkins-bot:
Add variants to the list of preferred languages

https://gerrit.wikimedia.org/r/279644

@bmansurov which URL(s) can I use to confirm?

dr0ptp4kt closed this task as Resolved.Mar 28 2016, 7:55 PM

Signing off.

Moving to done per @dr0ptp4kt