Page MenuHomePhabricator

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

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 created this task.Dec 10 2015, 6:44 PM
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 added a subscriber: Mhurd.
Restricted Application added subscribers: StudiesWorld, Aklapper. · View Herald TranscriptDec 10 2015, 6:44 PM
Mhurd updated the task description. (Show Details)Dec 10 2015, 6:50 PM
Mhurd set Security to None.
Mhurd updated the task description. (Show Details)Dec 10 2015, 6:54 PM
Mhurd updated the task description. (Show Details)Dec 10 2015, 7:02 PM
JMinor triaged this task as Normal priority.Dec 15 2015, 10:19 PM
JMinor lowered the priority of this task from Normal to Low.Jan 26 2016, 1:20 AM
JMinor removed a project: iOS-app-v5-production.