Wikimedia

Advanced: Remove or regenerate PNG files for Translate in MediaWiki's Translate extension

This task is about MediaWiki's Translate extension. This is already an advanced task, so if you have not worked on MediaWiki code before, this is not a task to start with!

The png files should be regenerated from the upgraded SVG files. However, these days basically all browsers that support JavaScript also support SVG. Hence, we can reduce our work by first doing an audit for which images only appear if JavaScript is enabled. This will both reduce further maintenance work as well as slim down the stylesheets.

This is not trivial:

  • First identify in which CSS/JS/PHP files the image is referenced
  • Those only mentioned in JS do not need PNG
  • Those mentioned in PHP likely need PNG
  • Those mentioned in CSS should be checked with Resources.php to find the resource modules
  • Those resource module names can be searched again to see on which pages they are used
  • Check those pages without JavaScript to see if some image appears without, those should keep PNG

I imagine most of these files are used on special pages such as Special:Translate and Special:AggregateGroups. You must have a basic Translate setup as documented.

You are expected to provide patches in Wikimedia Gerrit. See https://www.mediawiki.org/wiki/Gerrit/Tutorial for how to set up Git and Gerrit.

Task tags

  • images
  • php

Students who completed this task

Yifei He

Task type

  • code Code
  • assessment Outreach / Research
close

2017