**Problem:** [Switch-translated SVGs](https://commons.wikimedia.org/wiki/Commons:Translation_possible/Learn_more#Multiple_translations_within_one_SVG_file) can hold multiple translations in the same file. However when such files are used on other wikis, they need to have a `lang=<lang-code>` parameter for the image to render in the correct language.
Here's an example image: https://commons.wikimedia.org/wiki/File:Neural_crest.svg which contains translations for `ru`, `hr` and `de` as apparent from the //Render this image in// dropdown -
{F25076904}
This dropdown was added in [this patch](https://gerrit.wikimedia.org/r/#/c/mediawiki/core/+/95746/) in 2014.
Here's the image usage in [ruwiki](https://ru.wikipedia.org/wiki/Нервная_трубка), [hrwiki](https://hr.wikipedia.org/wiki/Humana_embriogeneza#Neurulacija), [dewiki](https://de.wikipedia.org/wiki/Neuralleiste). If you at the source, they contain `lang=ru`/`lang=hr`/`lang=de` after the file name (like `[[File:abc.svg|lang=de]]`)
This is problematic because:
* The file will not be updated on articles even if a translation is added for it on Commons. This is the case for a lot of files out there.
* It is an unfair work burden on non-enwiki contributors.
**Proposed solution:** MediaWiki should be smart enough to automatically show the file in the wiki language, if that translation exists. If not, it should fallback to the default.
**General direction for this investigation:**
* Find out what loads and creates the SVG links
* Find out what it means to conditionally change the SVG links based on content language
* Come up with an implementation plan, or, if there are multiple options, describe all relevant
**See also:**
* {T60920}
* T201207#4503458 - last few paragraphs
**Technical notes**
* MediaWiki stores the available translations for each SVG in the `img_metadata` field of the `image` table and this information is available via the `getAvailableLanguages()` function in MediaWiki's `SvgHandler` class.
* The thumbnails displayed on each wiki are actually PNG thumbnails generated by librsvg. librsvg handles rendering the SVG into a PNG with the desired systemLanguage.
* The solution of just generating thumbnails for every language was previously rejected as unnecessary cache fragmenting, as most languages won't actually have translations and thus would be identical to the English (default) thumbnail.