Page MenuHomePhabricator

Use sitematrix api instead of languages.json for language picker (when not picking article language)
Closed, ResolvedPublic

Description

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

Event Timeline

Mhurd raised the priority of this task from to Needs Triage.
Mhurd updated the task description. (Show Details)
Mhurd moved this task to Needs Triage on the Wikipedia-iOS-App-Backlog board.
Mhurd subscribed.
Mhurd set Security to None.
JMinor lowered the priority of this task from Medium to Low.Jan 26 2016, 1:20 AM
JMinor removed a project: iOS-app-v5-production.
JMinor claimed this task.
JMinor subscribed.

This was implemented via a command line build option.