Page MenuHomePhabricator

Expose translations that exist via the api
Open, Needs TriagePublic

Description

From https://meta.wikimedia.org/wiki/Library_Card_platform it's hard to find out which pages have translations programmatically

We can do something like https://meta.wikimedia.org/w/api.php?action=query&list=allpages&aplimit=max&apprefix=Library_Card_platform but that includes pages that aren't translations

It'd be nice if Translate either had a module for this, or exposed as some sort of page property...

Event Timeline

Reedy created this task.Feb 6 2019, 8:02 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptFeb 6 2019, 8:02 PM
Tgr added a subscriber: Tgr.Feb 7 2019, 1:49 AM

You can fetch https://meta.wikimedia.org/w/api.php?action=query&meta=messagegroupstats&mgsgroup=page-Library%20Card%20platform and filter out the languages with 0 translations (there should probably be a built-in flag to do that), although you'd have to know that fragments of a translated page are in the page-<pagename> message group (and that message groups are a thing) so yeah, not great. (Also why do I get a deprecation warning about mgstimelimit even though it's not used?)

Anomie added a subscriber: Anomie.Feb 7 2019, 8:25 PM

(Also why do I get a deprecation warning about mgstimelimit even though it's not used?)

Core API bug, it doesn't account for deprecated parameters that have default values. Filed T215548.

@Reedy Does the meta=messagegroupstats API satisfy your use case?

@Reedy Does the meta=messagegroupstats API satisfy your use case?

It's not my use case, it was a re-post of a question on irc... :)

I'm not sure what to do without additional feedback.

I asked the question and I think there should be a simpler and more straightforward way of retrieving the translated languages of a particular page.

Reedy added a comment.Feb 22 2019, 1:00 PM

I asked the question and I think there should be a simpler and more straightforward way of retrieving the translated languages of a particular page.

I'd agree; as is often the case, it's partially Documentation and T2001: [DO NOT USE] Documentation is out of date, incomplete (tracking) [superseded by #Documentation]

It's certainly not obvious from https://meta.wikimedia.org/w/api.php?action=help&modules=query%2Bmessagegroupstats how I would get the list of translations for a page