Wrong language tag in flathub's appstream.xml file

I’ve learned that appstream.xml files need to have BCP47 language tags [1]. So

<name xml:lang="pt-BR">Boxes</name>

is correct while

<name xml:lang="pt_BR">Boxes</name>

is not. Using the incorrect language tag pt_BR makes flatpak ignore the translation of the language variant and use pt instead.

For instance, searching for GNOME Boxes with LC_ALL=pt_BR.utf-8 flatpak search boxes shows me app name “Caixas” (pt) when “Boxes” was the expected.

So I searched Flathub’s appstream.xml file (/var/lib/flatpak/appstream/flathub/x86_64/<huge_hash>/appstream.xml) for <name xml:lang="pt_BR"> and with pt-BR, and right now Flathub has 412 apps with the incorrect language tag and 173 apps with the correct one. I’d love to have all this using the correct tag.

According to [1], to fix this the apps need to use “itstool or a more recent version of xgettext”.

If I understood correctly, the builds are done centralized fashion once the repository at Flathub · GitHub is updated.

Any suggestion where should report this in order to try to fix or at least to get more information on the infrastructure beneath?

What version of xgettext or itstool has the fix? They come from the runtime.

It could also be that the 412 apps you found haven’t been rebuilt in a long time or are on EOL runtimes. In that case, nothing we can do.

You can try approaching the apps individually for the ones you care most and ask them to update the runtime or ask for a rebuild.

I don’t know about itstool, but it’s fixed in gettext since version 0.23 (after this bug report and this and this commits).

Sadly I unable to tell which gettext version is used in each build. Freedesktop SDK has a gettext.bst file, so I’m assuming it’s this runtime that provides gettext dependency. But it’s wild guess. If you can enlighten me with that information, maybe I can investigate further.

but it’s fixed in gettext since version 0.23

25.08 will have gettext 0.24. So you have to wait until that is out in August.

24.08 and 23.08 are stuck on an older release due to ABI breaks.

1 Like

The apps I’m particularly interested in seeing corrected use org.gnome.Sdk, which (if I understand correctly) depends on org.freedesktop.Sdk and, therefore, gettext. If that is the case, then I’ll have to wait the release of 25.08 and then org.gnome.Sdk to be released depending on org.freedesktop.Sdk 25.08. This looks like a lot of time, but at least I see a light in the end of the tunnel :smiley:

By the way, I was pointed out to your commit that updates gettext version. Thanks for the fix and for the information above.