Page MenuHomePhabricator

[BUG] Changing the Chinese variant of an article in "Other languages" does not work for logged in users
Closed, ResolvedPublic

Description

Steps to reproduce

Pre-conditions: While logged in with no user-preferences set on zh.wiki for reading in a particular variant.

  1. Open an article in one variant of Chinese, for example 美國 (America) in Traditional Chinese (ZH-HANT)
  2. Note the article content (ignore the title for now since work T178201 has altered its display logic) is all shown in Traditional Chinese (for example all references to "美國" uses the traditional character "國" for country/land)
  3. Open "Other languages" and select to view the Simple Chinese variant of the article

Expected

Article reloads in Simplified Chinese variant

Actual

Nothing changes since the default user preference of 'zh - 中文' overrides the variant transform and shows article with mixed content.

This is the case for ALL Chinese articles, whatever the first starting point variant is chosen, changing to the other does not work.
See demo video of this bug: https://youtu.be/sB_KZR1TdY8

Event Timeline

+ @cooltey - not sure if this is related to the patch for T178201/ T191560

@RHo I cannot reproduce it on my device. Did you test while you are logged in? Please try to log out and test it again to see whether if it is reproducible.

@cooltey - I'm able to reproduce on my Pixel 2 and Nexus 5 after logging out and logging back in.

https://zh.wikipedia.org/wiki/Special:参数设置

Preferences_-_Wikipedia.png (1×1 px, 306 KB)

I think I found where the issue came from.

In the zh.wikipedia site, we can setup the Content language variant, and I believe currently you are setting in zh - 中文 instead of more specific variant like zh-Hant - 繁體

If so, we cannot do anything because whatever language code we send to the API, it will be overridden base on your language preference in your zh.wikipedia account.

In the zh - 中文, it will show the mixed variants content for every articles (if they have).

Oh derp that is tricky :/
Can we get around this by fetching the specific variant URL instead when 'Other language' is selected?

Currently, for a logged in user with no specific variant set up, we fetch https://zh.m.wikipedia.org/wiki/贝拉克·奥巴马 so the user will see mixed variant text no matter which variant is chosen.

Proposed, instead, we fetch https://zh.m.wikipedia.org/zh-cn/贝拉克·奥巴马 if Simplified Chinese is selected,
and https://zh.m.wikipedia.org/zh-tw/巴拉克·歐巴馬 if Traditional Chinese is selected.
Ie., replace "wiki" in the URL string with either zh-cn or zh-tw ?

@RHo

For logged in user, we will still get the mixed content by fetching the specific variant URL.

You can test it by using this etherpad URL: https://etherpad.wikimedia.org/p/DeepLinkForTests

RHo renamed this task from [BUG] Changing the Chinese variant of an article in "Other languages" is no longer working to [BUG] Changing the Chinese variant of an article in "Other languages" does not work for logged in users.Apr 6 2018, 5:28 PM
RHo updated the task description. (Show Details)

Change 424644 had a related patch set uploaded (by Cooltey; owner: Cooltey):
[apps/android/wikipedia@master] Fix: Chinese variants issue for logged in users

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

Change 424644 merged by jenkins-bot:
[apps/android/wikipedia@master] Fix: Chinese variants issue for logged in users

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