[AppStream] The AppStream XML locale apocalypse
Matthias Klumpp
matthias at tenstral.net
Tue Apr 11 08:33:22 UTC 2023
Am So., 9. Apr. 2023 um 01:01 Uhr schrieb Matthias Klumpp
<matthias at tenstral.net>:
>
> Am Fr., 7. Apr. 2023 um 10:37 Uhr schrieb Richard Hughes <hughsient at gmail.com>:
> >
> > Counter proposal: just continue to use the underscore locale variant and save a lot of heartache...? R
>
> I can't, as most XML translation tools use the proper BCP47 format,
> such as KDE's, itstool and possibly a lot more. About 54% of metadata
> are in BCP47 format (checked with Debian's data), which is really
> significant.
>
> If there was any way out of this that doesn't involve adjusting so
> much locale processing and would work with all existing tools, I'd
> love to know it though... But I don't see it :-/
I investigated the cases of out-of-spec XML locale further, and the
reason for them seems to be that Meson is calling msgfmt on XML files
the wrong way - the manual page explicitly demands the locale
attribute to be given when in XML mode, which Meson doesn't do,
falling back to bad autodetection.
To be fair to Meson though, msgfmt does not enforce this requirement
and makes it really easy to shoot yourself in the foot. Itstool is
better here and just does the right thing.
Changing this in Meson is also inconvenient, because it would make one
invocation of msgfmt explode in as many invocations as the project has
languages.
Ideally msgfmt would just behave correctly here when it has less information.
So, some projects do the right thing and call msgfmt the intended way,
but every single one using Meson is wrong(tm) - oof!
Anything CMake however seems to be in-spec.
I believe this issue is super old though and probably predates Meson.
--
I welcome VSRE emails. See http://vsre.info/
More information about the AppStream
mailing list