List of steps to reproduce (step by step, including full links if applicable):
- go to Commons File:SVG_MW_Test_Switch.svg. That file has generic Spanish (es) and several langtags for Spanish-speaking countries.
- select "Render this image in" Spanish (es) and click "GO"
- That should take you to https://commons.wikimedia.org/w/index.php?lang=es&title=File%3ASVG_MW_Test_Switch.svg (or just go directly to that URL)
- Look at the "Render this image in" dropdown. It says "es-ag" rather than "Spanish (es)".
- View the file page HTML source and find the img element taht displays the main image. It's src attribute is src="https://upload.wikimedia.org/wikipedia/commons/thumb/f/f6/SVG_MW_Test_Switch.svg/langes-ag-512px-SVG_MW_Test_Switch.svg.png?20220703211320"
What happens?:
The Render this image dropdown displays es-ag rather than Spanish (es).
The src attribute has .../langes-ag-512px... rather than ../langes-512px...
What should have happened instead?:
The dropdown should display "Spanish (es)".
The src attribute should be ../langes-512px....
The File page also displays a gallery of the SVG with |lang=es and |lang=es-MX. The src attributes on those img elements are correct, but the rendering is incorrect for Mexican Spanish due to a librsvg langtag matching bug. This report is not about that bug.