Page MenuHomePhabricator

Add Support for languages with variant URLs
Closed, DeclinedPublic

Description

Sometimes I find links to /zh-tw/Article_name, which are unusable (Page not found) on Wikipedia Mobile, such as http://zh.m.wikipedia.org/zh-tw/%E7%9B%B4%E6%B5%81%E9%9B%BB.

Note that http://zh.wikipedia.org/zh-tw/%E7%9B%B4%E6%B5%81%E9%9B%BB works.


Version: --
Severity: major
URL: http://zh.m.wikipedia.org/wiki/%E4%BA%A4%E6%B5%81%E9%9B%BB

Details

Reference
bz21975

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:48 PM
bzimport set Reference to bz21975.
bzimport added a subscriber: Unknown Object (MLST).

On which pages are you finding those links ?

On zhwiki (and srwiki etc.), we have the setting like:

$wgArticlePath = "/$2/$1";

In MediaWiki's parser, $2 will be replaced with a variant code of the content language of this wiki if available, and this path is equivalent to /w/index.php?title=$1&variant=$2.

That's to say, once MediaWiki's parser decides to generate a link with a variant parameter, such broken link will be generated. The condition varies, such as whether the user is anonymous, whether variant= exists in the URL of the request, or what Accept-Language header the user requests with, and so on.

What I meant was, are you opening such URLs and being redirected to the broken version of the URL mobile page, or do you find these links inside the text of pages presented by the mobile interface. Those are 2 different issues.

Such URLs like http://zh.m.wikipedia.org/zh-tw/%E7%9B%B4%E6%B5%81%E9%9B%BB are generated by the parser from [[WikiLink]]s in articles.

With http://github.com/hcatlin/wikimedia-mobile/commit/f2959482bbee8cfd99e07daeb83083c9118900fe

the router now recognizes variant urls and will retrieve the /wiki/ version of that article. Next step is to retrieve the variant version of the page perhaps, but we don't have a way to switch variants yet, so we probably need to think about that before we apply variants.

I don't know whether this is a deploy problem, but at least http://zh.m.wikipedia.org/wiki/%E8%A1%8C%E5%88%97%E5%BC%8F?variant=zh-hans is not working (page still shown with no variant).

Do not expect mobile site to accept as many parameters as main sites. /zh-hans/ is designed to be supported, and this is expected to be the only style of URLs generated by mobile sites parsers.

Home is really a bug.

Besides, please generate /zh-hans/ links if user is viewing pages with /zh-hans/ URLs.

It seems that all my changes have disappeared recently...
Looking into it.

It seems this only affects the ::Home page right ?

(In reply to comment #13)

It seems this only affects the ::Home page right ?

AFAICS ::Home is working right now. Actually http://zh.m.wikipedia.org/zh-hans/ is failing, which jumps back to http://zh.m.wikipedia.org/.

The functionality of the links is now fixed in MobileFrontend. I created ticket 38101 for the switching of the variants.