Page MenuHomePhabricator

Add caption on Commons
Open, MediumPublicFeature


In the framework of structured data, it is now possible to add multilingual captions for each file. The RecordWizard should add caption for each new recording that is uploaded to Commons.

Event Timeline

Pamputt changed the subtype of this task from "Task" to "Feature Request".Oct 6 2020, 8:14 PM

Can caption diffs be improved in order to emphasize just the differences? It took me some time to find what had changed in the diff below:

@Capmo, I think your comment is not related to what is described in this task. It is about teh RecordWizard, a tool used on Lingua Libre.

I've opened a new task (T267297) to track your request.

Would it require to use Translatewiki to provide a "translation" for these captions?

Or would it just add an English caption like: "Recording of <theword> in <language> by <locutor> from <place>" ?

I am not aware that Translatewiki is linked to the "Commons captions".

I am fine just with "Recording of <theword> in <language> by <locutor>" (without from <place>). The place of residence is not mandatory in LinguaLibre so this field might be empty.

I am not aware that Translatewiki is linked to the "Commons captions".

I was relating to the eventual use of multilingual captions. That is, to use Translatewiki to translate the "template" caption into any language, and then add these captions in all the languages we can at the time of the import.

Or, we could just stick to an English caption. At least to begin with.

On the technical side of things: this would require a change in Upload2Commons. The captions cannot be set *while* uploading the file. This topic is briefly covered in Commons:File captions#Technical. In a nutshell, this would require the addition of two queries to the Commons API:

  1. Query the page info of the file, in order to get its pageid and therefore retrieve the file's entity id in the Commons' Wikibase (which is M<pageid>, e.g. a file with pageid=132 has M132 as its entity id).
  2. Send the caption with wbsetlabel (something along the lines of api.php?action=wbsetlabel&id=M132&language=en&value=caption&format=jsonfm).

And... That's pretty much it. That seems quite straightforward to do.