Tagged for production per Josh.
When we're picking language an article is available in, we ask the server and the query gives us the languages including a localized version of the language names. This is good.
But when we're just showing the language picker not scoped to an article, we're using a json file to show the full list, but this json file doesn't have localized names because the matrix is very big. This is not good. To show localized lang names in this case we're asking iOS if it has localized lang name for a lang code, but it doesn't always and these localized lang names may slightly differ from those returned by the query mentioned above. iOS also doesn't give us back good names for compound lang codes - i.e. it always returns "Chinese" if the lang code starts with "zh-", when we need it to return "Cantonese" or "Classical Chinese" etc. to be consistent with the article lang api output.
Thanks to Brian for finding the sitematrix api, which we can use for the non-article-lang-picker use case to solve this issue!
Query for list of lang wiki's with local names in English:
https://www.mediawiki.org/w/api.php?action=sitematrix&format=jsonfm&smtype=language&smstate=all&smlangprop=code%7Clocalname&smsiteprop=code&uselang=en
Query for list of lang wiki's with local names in Hebrew:
https://www.mediawiki.org/w/api.php?action=sitematrix&format=jsonfm&smtype=language&smstate=all&smlangprop=code%7Clocalname&smsiteprop=code&uselang=he