Page MenuHomePhabricator

Update our list of languages and variants.
Closed, ResolvedPublic4 Estimated Story Points


This is something that hasn't sat right with me for a while:

If we look at any article in Chinese (on desktop or mobile web), we are given an option to select the variant of Chinese for reading the article. The number of these variants is no less than six. So then, why do we offer only two variants in the app? Should we not also offer all the possible variants?

The API that we currently use for building our list of languages is the sitematrix API:

That API returns a list of sites (i.e. wikis), each with the base language for that wiki. And then we have special code for inserting the variants zh-hans and zh-hant for the case of zhwiki.

It might be cleaner, and much more complete, to use the siteinfo API:

This gives us a list of language codes (instead of site codes) and their corresponding names (which are actually more correct than the names given by sitematrix). The names are the local language names by default, but can be given in any language, e.g. English:

And furthermore, this API gives us the full list of variants, not just for Chinese but a large number of other languages. Certainly we could combine this API with the current sitematrix call to see which languages map to which wikis.

Useful deep links collection for testing language variants.

Test wiki for testing in-app links

Event Timeline

cooltey updated the task description. (Show Details)

Looks like the Kazakh (kk) does not show the article in the correct language variant, maybe it is a mobile-html or mediawiki API issue.Үйде_жалғыз_қалғандаҮйде_жалғыз_қалғанда (default: kk-kz)Үйде_жалғыз_қалғанда with Accept-Language: kk-latn, it only changes the article title.Үйде_жалғыз_қалғанда with Accept-Language: kk-arab, it only changes the article title too.

@Mholloway @MSantos @bearND Any thoughts? Please let me know if I need to create a ticket for this issue, thanks.

PCS language variant handing currently appears only to handle zh (Chinese) and sr (Serbian) variants (and only the general zh-hans and zh-hant variants in the case of Chinese). See lib/wikiLanguage.js and lib/wikiLanguageMapping.json. We'd be better off grabbing the full language variant info from siteinfo (just as @Dbrant suggests doing here in the Android app) rather than working from a hard-coded list.

Let's open a separate task for the proposed Page Content Service update.

Let's open a separate task for the proposed Page Content Service update.

Sure! Thanks @Mholloway

Hi @MSantos, I assigned you to this separate task for the proposed update: T265687

ABorbaWMF added a subscriber: ABorbaWMF.

Tested all the links on the etherpad above and they all worked except for the ones that were noted as 'not working'. Tested on 2.7.50333-alpha-2020-10-22