Page MenuHomePhabricator

Remove or regenerate PNG files for Translate
Closed, ResolvedPublic

Description

Per discussion from https://gerrit.wikimedia.org/r/#/c/380062/

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.

I am adding the easy tag, even though this is not trivial:

  1. First identify in which CSS/JS/PHP files the image is referenced
  2. Those only mentioned in JS do not need PNG
  3. Those mentioned in PHP likely need PNG
  4. Those mentioned in CSS should be checked with Resources.php to find the resource modules
  5. Those resource module names can be searched again to see on which pages they are used
  6. 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. Basic Translate setup is needed as documented in mediawiki.org

Event Timeline

This should be done in two independent steps:

  1. First remove the PNG files
  2. Then regenerate the remaining ones

There is some guidance how to generate an optimized PNG file from SVG.

Not the easiest task, but should be doable in GCI.

Change 401658 had a related patch set uploaded (by Eflyjason; owner: Eflyjason):
[mediawiki/extensions/Translate@master] Remove or regenerate PNG files for Translate

https://gerrit.wikimedia.org/r/401658

We have to remove the .png reference from the .less/.css files right?

Yes those must be removed. I filed T179563: Lacking mixing for SVG only background images earlier to clarify how to do this. It is not yet resolved, but I suggest we just standardize on this code when PNG is not used:

  • LESS files: .background-image( '....svg' );
  • CSS files: background-image: /* @embed */ url( ....svg );

In some cases this means taking the url out of background: rule.

Change 401658 merged by jenkins-bot:
[mediawiki/extensions/Translate@master] Remove or regenerate PNG files for Translate

https://gerrit.wikimedia.org/r/401658

Change 402039 merged by Nikerabbit:
[mediawiki/extensions/Translate@master] Remove search.png for Translate

https://gerrit.wikimedia.org/r/402039