A multilingual infobox for Wikimedia Commons categories | By Mike Peel

  • July 21, 2018
Image showing the infobox in source editor, and the resulting infobox on Commons.

Mike Peel is a UK Wikimedian who is running a session on the development of multilingual infoboxes on Wikimedia Commons at Wikimania 2018 in Cape Town. You can see the session information here.

_____________________________________________________

Wikimedia Commons is a multilingual repository holding multimedia related to all possible topics. All language Wikipedias, as well as other projects, rely on the content hosted on Commons. However, MediaWiki is monolingual by default, so the defacto language on Commons is English, with category names in English — even for non-English topics.

As a result, it can be difficult for non-English speakers to understand the context and scope of a category. Sometimes manual descriptions and translations are present, along with various different utility templates, but the amount varies dramatically between categories.

Wikidata content, however, is inherently multilingual. Topics have Q-identifiers, and statements are made using properties, all of which are translatable. Structured Data on Commons (a Wikimedia project to ‘Wikidatafy’ Commons and improve its searchability) will soon use this system on file description pages – but it can also make the categories significantly easier to use by providing information relevant to the category in the user’s preferred language through an infobox.

Implementation

{{Wikidata Infobox}} is designed to be one infobox that work for all topics in all languages. It is written using parser functions, and it primarily uses [[User:RexxS]]’s Lua module [[Module:WikidataIB]] to fetch the values of nearly 300 properties from Wikidata, along with their qualifiers (and more can be added on demand). The label language is based on the user’s selected language.

The values are then displayed in various different formats such as strings, links, dates, numbers with units, and so on, as appropriate. The main image, as well as flags and coats of arms, are also displayed, along with the Wikidata description of the topic

Coordinates are displayed with Geohack and links to display the coordinates of all items in the category. Maps are displayed in the user’s language using Kartographer, with the map zoom level based on the area property for the topic. Links to Wikipedia, Wikivoyage, etc. are displayed where they are available in the user’s language. Links to tools such as Reasonator and Wikishootme are also included.

For categories about people, the infobox automatically adds the birth, death, first name and surname categories, along with tracking categories like ‘People by Name’. Authority control IDs are also displayed as external links, and ID tracking categories can also be automatically added.

Poster on Template:Wikidata Infobox by Mike Peel – image CC BY-SA 4.0

Roll-out

You can easily add the infobox to categories that have a sitelink on Wikidata: just add {{Wikidata Infobox}}!

The infobox was started in January 2018, with several test categories. An initial discussion on Commons’ Village Pump was very positive, and by the end of February it had been manually added to 1,000 categories, increasing to 5,000 by mid-March. Work on a bot to deploy the template was started in February, and was approved by the community by the end of April, when around 10,000 categories had infoboxes. The bot roll-out was started slowly to catch any issues with the infobox design, and particularly increases in the server load – but no server load issues arose.

In parallel, over 500,000 new commons sitelinks were added to Wikidata using P373 (the ‘commons category’ property) and monument ID matching, and many links to category redirects have been fixed. This has also caused many new interwiki links to be displayed in Commons categories.

In mid-June 2018, with the use of Pi bot and friends to add the infobox to categories, uses of the Wikidata infobox passed 1 million.

Next steps

The infobox continues to evolve and to gain new features, for example the implementation of multilingual interactive maps using Kartographer was quickly added to the infobox to make it available in over 600,000 categories displaying a map. More properties are being added to the box, although striking a balance between keeping the infobox small and adding relevant new properties is an ongoing discussion.

The infobox is not used where other boxes such as {{Creator}} and “category definition” are already in use; this could potentially change so that there is a uniform look across all categories. It is also not used for taxonomy categories due to different taxonomy structures on Commons and Wikidata.

Over 4 million Commons categories do not yet have a sitelink on Wikidata, so there is plenty of scope to add the infobox to more categories! The infoboxes will update and grow as more information and translations are added to Wikidata – so if you see wrong or untranslated information in them, correct it on Wikidata!

WikidataIB and the other tools used here (or even the entire infobox!) can easily be installed on other Wikimedia projects – providing that there is community consensus to do so!

Leave a Reply

Your email address will not be published. Required fields are marked *