To help communities use translated SVGs created by SVG Translate Tool, Parser should by default use page language for thumbnails. Currently, the default language is used unless the user explicitly specified a language, e.g. [[File:Foo.svg|lang=sq]].
The full discussion of how this could look is at T202181: [Spike 4 hours] Investigate the work involved in defaulting SVGs to show wiki language if available, the technical plan is the following:
- Create a way for Parser::makeImage to let the media handler to know page's content language, as controlled by a feature flag.
- Because varying all SVGs for all languages would generate a lot of distinct thumbnail URLs and thus create a huge load on caches and scalers, SvgHandler should be aware of languages actually present in the image and not create image URLs varied by languages needlessly.
- Caveat: this requires loading image metadata, need to make sure performance will not suffer.
Potential production impact: while currently most SVG thumbnails are in form of https://upload.wikimedia.org/wikipedia/commons/thumb/6/60/Neural_crest.svg/450px-Neural_crest.svg.png i.e. using default language, this change will result in more language-specific thumbs like https://upload.wikimedia.org/wikipedia/commons/thumb/6/60/Neural_crest.svg/langru-450px-Neural_crest.svg.png.
- Currently, ~2.6% of files on Commons are SVGs.
- Current number of translated ones of them is negligible, but this project aims to increase this number.
- The plan above requires that language-specific URLs will be generated only when a translation in the requested language is present.