Run strict validation on AppData file
Stephan Bergmann
sbergman at redhat.com
Wed May 22 12:40:54 UTC 2019
An issue started to appear when I tried building a new version of
LibreOffice for Flathub. While recent test build
<https://flathub.org/builds/#/builders/32/builds/3710> was successful
(albeit with warnings), the corresponding official build
<https://flathub.org/builds/#/builders/32/builds/3811> fails now due to
validation errors at <https://flathub.org/builds/#/builders/24/builds/370>:
> flatpak run org.freedesktop.appstream-glib validate-strict builddir/*/share/appdata/org.libreoffice.LibreOffice.appdata.xml
> in dir /srv/buildbot/worker/build-i386-3/build (timeout 1200 secs)
> watching logfiles {}
> argv: b'flatpak run org.freedesktop.appstream-glib validate-strict builddir/*/share/appdata/org.libreoffice.LibreOffice.appdata.xml'
> using PTY: False
> builddir/files/share/appdata/org.libreoffice.LibreOffice.appdata.xml: FAILED:
> • tag-missing : <translation> not specified
> • value-missing : <!-- Copyright [year] [name] --> is not present
> • aspect-ratio-invalid : <screenshot> aspect ratio not 16:9 [https://hub.libreoffice.org/screenshots/writer-01.png]
> • aspect-ratio-invalid : <screenshot> aspect ratio not 16:9 [https://hub.libreoffice.org/screenshots/calc-02.png]
> • aspect-ratio-invalid : <screenshot> aspect ratio not 16:9 [https://hub.libreoffice.org/screenshots/impress-01.png]
> • aspect-ratio-invalid : <screenshot> aspect ratio not 16:9 [https://hub.libreoffice.org/screenshots/draw-02.png]
> • aspect-ratio-invalid : <screenshot> aspect ratio not 16:9 [https://hub.libreoffice.org/screenshots/base-02.png]
> • translations-required : <name> has no translations
> • translations-required : <summary> has no translations
> • translations-required : <description> has no translations
> Validation of files failed
> program finished with exit code 1
> elapsedTime=3.802360
The previous test build had failed hard due to a missing content_rating
element in the AppData file. I complained about that rather surprising
change of things and thought that I was done for now with massaging
LibreOffice's AppData after I had added that. But apparently I was wrong.
Now, I can probably add a copyright comment and do something about the
screenshot aspect ratios, but the rest of the complaints above leave me
clueless:
LibreOffice does internally use gettext by now, and it contains various
/app/share/runtime/locale/*/resource/*/LC_MESSAGES/*.mo files, so I
should probably add a translation element with attribute type="gettext".
But what should the content of that element be?
<https://www.freedesktop.org/software/appstream/docs/chap-Metadata.html#sect-Metadata-GenericComponent>
is completely silent on that topic and just gives an unhelpful
"<translation type="gettext">foobar</translation>" example, while
<https://github.com/flathub/flathub/wiki/AppData-Guidelines#translations>
states that "you’ll need to provide the prefix of these files with a
<translation/> tag"---whatever "the prefix of these files" is meant to be.
For the "translation-required" of the name, summary, and description
elements, how would I even specify such translations? An additional
name element with an xml:lang="..." attribute?
<https://www.freedesktop.org/software/appstream/docs/chap-Metadata.html#sect-Metadata-GenericComponent>
again appears to be completely silent on that, as does
<https://github.com/flathub/flathub/wiki/AppData-Guidelines>.
More information about the Flatpak
mailing list