Fix handling of localised screenshot images
Hi, I have metainfo.xml.in with screenshot entries like this (sample of two languages only; other languages removed):
<screenshots>
<screenshot type="default">
<_caption>The main window</_caption>
<image type="source" width="1600" height="900">https://www.damonlynch.net/rapid/metainfo/2020/03/mainwindow.png</image>
</screenshot>
<screenshot>
<_caption>Renaming</_caption>
<image type="source" width="1600" height="900">https://www.damonlynch.net/rapid/metainfo/2020/03/photorename.png</image>
</screenshot>
<screenshot type="default">
<_caption>The main window</_caption>
<image type="source" width="1600" height="900" xml:lang="fr">https://www.damonlynch.net/rapid/metainfo/2020/03/fr/mainwindow.png</image>
</screenshot>
<screenshot>
<_caption>Renaming</_caption>
<image type="source" width="1600" height="900" xml:lang="fr">https://www.damonlynch.net/rapid/metainfo/2020/03/fr/photorename.png</image>
</screenshot>
</screenshots>
I had assume that the screenshot tagged with the image tag xml:lang="fr" would only be seen by those with the French system locale. But instead every user sees it regardless of system locale. And because I've have generated actual internationalized screenshots for more than 20 languages, with two screenshots each, that means the user sees a LOT of screenshots for the program in Gnome Software!
Is the problem that I have misunderstood how screenshot internationalization works? Is it meant to be that every user will see every screenshot from every locale? Or is it because when intltool-merge is run on the metainfo.xml.in, the caption tag is being converted into something like the following (in this case for French, but it is like this for every screenshot):
<screenshot type="default">
<caption>The main window</caption>
<caption xml:lang="ca">La finestra principal</caption>
<caption xml:lang="cs">Hlavní okno</caption>
<caption xml:lang="da">Hovedvinduet</caption>
<caption xml:lang="de">Das Hauptfenster</caption>
<caption xml:lang="el">Το κύριο παράθυρο</caption>
<caption xml:lang="es">La ventana principal</caption>
<caption xml:lang="fr">La fenêtre principale</caption>
<caption xml:lang="hu">A főablak</caption>
<caption xml:lang="ja">メインウィンドウ</caption>
<caption xml:lang="nl">Hoofdvenster</caption>
<caption xml:lang="nn">Hovudvindauget</caption>
<caption xml:lang="pl">Okno główne</caption>
<caption xml:lang="pt_BR">A tela principal</caption>
<caption xml:lang="ru">Главное окно</caption>
<caption xml:lang="sr">Главни прозор</caption>
<caption xml:lang="tr">Ana pencere</caption>
<image xml:lang="fr" width="1600" type="source" height="900">https://www.damonlynch.net/rapid/metainfo/2020/03/fr/mainwindow.png</image>
</screenshot>
Is the multitude of caption tags throwing off the Gnome Software algorithm that decides which screenshots to present?
I have no idea how to test to see what Gnome Software will display until the program has already been packaged into a distribution and published, and by that time it's too late.
One thing I realized while filing this issue is that Gnome Software doesn't seem to use the captions in any case.