Look at Parsoid's output below for a localized thumbnail on cswiki.
$ echo "[[Soubor:Global_Temperature_Anomaly.svg|lang=cs|320px|okraj]]" | php bin/parse.php --domain cs.wikipedia.org <p data-parsoid='{"dsr":[0,61,0,0]}'><span class="mw-image-border" typeof="mw:Image" data-parsoid='{"optList":[{"ck":"lang","ak":"lang=cs"},{"ck":"width","ak":"320px"},{"ck":"border","ak":"okraj"}],"dsr":[0,61,null,null]}'><a href="./Soubor:Global_Temperature_Anomaly.svg" data-parsoid="{}"><img resource="./Soubor:Global_Temperature_Anomaly.svg" src="//upload.wikimedia.org/wikipedia/commons/thumb/f/f8/Global_Temperature_Anomaly.svg/320px-Global_Temperature_Anomaly.svg.png" decoding="async" lang="cs" data-file-width="1440" data-file-height="1000" data-file-type="drawing" height="222" width="320" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/f/f8/Global_Temperature_Anomaly.svg/480px-Global_Temperature_Anomaly.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/f/f8/Global_Temperature_Anomaly.svg/640px-Global_Temperature_Anomaly.svg.png 2x" data-parsoid='{"a":{"resource":"./Soubor:Global_Temperature_Anomaly.svg","lang":"cs","height":"222","width":"320"},"sa":{"resource":"Soubor:Global_Temperature_Anomaly.svg","lang":"lang=cs"}}'/></a></span></p>
The image resource doesn't have a language specific thumbnail (it has the lang="cs" attribute) whereas the legacy parser uses https://upload.wikimedia.org/wikipedia/commons/thumb/f/f8/Global_Temperature_Anomaly.svg/langcs-320px-Global_Temperature_Anomaly.svg.png. https://cs.wikipedia.org/api/rest_v1/page//Wikipedista:SSastry_(WMF)/Sandbox has this wikitext for testing purposes.
Thanks to @vadim-kovalenko for the investigation.
Original Bug Report
Steps to Reproduce:
- Go to "Skleníkový efekt" (permalink) on cswiki.
- Trigger preview of "globální oteplování" at the end of the third paragraph (links to Globální oteplování on cswiki).
Actual Results:
- The preview image (a multilingual SVG file) is displayed with English captions.
Expected Results:
- The preview image is displayed with Czech (local) captions, just like it's displayed in the linked article.
preview | article |
This could be related to T208620 but I'm reporting it separate for Page-Previews.
If resolving the other task would also resolve this one, there is no other way to fix this and no need to track them separately, they can be merged.