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