Page MenuHomePhabricator

Have the ZMultilingualString component fetch the list of allowed languages from an API
Closed, ResolvedPublic

Description

Currently the ZMultilingualString component renders a selector with the list of language codes (and language name in the user's selected language) that comes from the backend in the extWikilambdaEditingData config variable.

We can isolate this front-end component a bit more if we allow it to fetch the dropdown data from an API.

As seen in the API Sandbox we can get all the language codes from /api.php?action=query&format=json&meta=languageinfo, but I haven't found how to get the language names as well, any ideas?

Event Timeline

it could be done by adding name prop (default: only code) to the languageinfo meta query &liprop=code|name

Wonderful!!! Thanks, Gabriel :D

(@gengh I'm wondering if you're working on this?)

Jdforrester-WMF renamed this task from Allow the ZMultilingualString component to fetch the content of its dropdown from an API to Have the ZMultilingualString component fetch the list of allowed languages from an API.Feb 2 2021, 5:48 PM
Jdforrester-WMF subscribed.

(@gengh I'm wondering if you're working on this?)

Please take it if you're interested. :-)

Change 661156 had a related patch set uploaded (by Gabrielchihonglee; owner: Gabrielchihonglee):
[mediawiki/extensions/WikiLambda@master] Fetch language list from API for ZMultilingualString component

https://gerrit.wikimedia.org/r/661156

Change 661156 merged by jenkins-bot:
[mediawiki/extensions/WikiLambda@master] Fetch language list from API for ZMultilingualString component

https://gerrit.wikimedia.org/r/661156