Page MenuHomePhabricator

Babel definitions for an user should be made available through the api
Closed, ResolvedPublic

Description

Given that I am either logged in or anonymous
When I ask for api.php?action=query&list=users&usprop=<any user name>
Then I would get a list of language names and proficiency levels

These definitions are already published and I see no reason not to make them available through the public api.

Event Timeline

TTO triaged this task as Low priority.Jan 1 2017, 11:30 AM
TTO added subscribers: Anomie, Legoktm, TTO.

An API for Babel has been added by @Legoktm since this task was filed: https://en.wikipedia.org/w/api.php?action=query&meta=babel&babuser=This,_that_and_the_other But it can only process one user at a time.

A multi-user API looks straightforward to implement for the case that $wgBabelUseDatabase is true, and it would probably be doable (some juicy direct SELECTs on the categorylinks table) when that flag is false. The biggest impediment is that ApiQueryUsers in core is not extensible. @Anomie: Is this lack of extensibility intentional, or would you be OK with adding copious hooks to this module? I can imagine that something like CentralAuth would really benefit from adding data to ApiQueryUsers...

I don't know about copious hooks, but reasonable hooks would be reasonable. Enabling the hooks added in rMWa514341e365c: API: Add hooks for ApiQueryBase's query and row-processing might be sufficient.

Interesting, can someone please document the API mentioned on some searchable from https://www.mediawiki.org/wiki/Extension:Babel page place? Also on a related note is there a replicabable to Labs DB with the information?

some juicy direct SELECTs on the categorylinks table when that flag is false

The plan is to remove the category version of getting data once the database version is fully deployed to Wikimedia wikis.

jeblad claimed this task.

Seems like it is implemented…