Goal of this ticket is to understand what are the options available and decide what should be used for the Wikipedia Preview gallery caption information.
We have researched what are the current captions being used with different Wikipedia galleries (such as in iOS, Android, mobile web). We think it's probably best to aim for consistency across galleries.
Here are some examples from the gallery of the Wikipedia article for "ivory":
As part of the research to simply understand what are the possible options, note that:
- I'm including the commons.wikimedia.org/wiki/File for each example. In that link, you can see that images have a 'Caption' table (sometime with more than one language) as well as a 'Description' field in the 'Summary' table . We are looking at both of those to understand what's usable and available.
- We currently know that:
- we can obtain description value from Commons with query like this 
- we can obtain a caption value from media-list endpoint 
- It seems the mobile web gallery is the only one using media-list caption, where as Android and iOS use Commons data
Questions that need to be answered
- What is the caption value we should use for the Wikipedia Preview gallery? Is there a specific logic to follow if more than one value is available (for example, use description if available, otherwise use caption)?
- If we are to use the value from the 'Caption' table (sometime with more than one language) in Commons (as shown in ), what is the API query for that? We have reviewed the corresponding documentation  but haven't found any information with regard to that caption field
API Documentation: https://www.mediawiki.org/wiki/API:Imageinfo
Use this order to determine what content to show for image descriptions:
- Commons captions.
- If that is not available; show the description from Commons.
- If that is not available; show the description from media-list.
For optimization reasons, we are not following the above recommended order and keeping the gallery caption description similar to the iOS app.