[MPlayer-dev-eng] Localized messages and locale in GUI

Reimar Döffinger Reimar.Doeffinger at gmx.de
Thu Feb 25 10:13:50 EET 2021



> On 23 Feb 2021, at 23:57, Ingo Brückl <ib at wupperonline.de> wrote:
> 
> Reimar Döffinger wrote on Tue, 23 Feb 2021 22:28:59 +0100:
> 
>> from what I remember the gettext API can be used "manually" specifying the
>> locale instead of via setlocale, even if it's a bit more painful.
> 
> I have never heard of this, do you have any further information?
> 
> To my knowledge, gettext stops translating as soon as the locale is set to C.

I never managed to find all the pieces, but in the source there
is a reference to “libglocale” or such, and for that case it
defines a gl_gettext function that takes the locale name as argument,
and ignores whatever locale the C library is set to.
There might be also other translation libraries that provide that kind
of functionality without the weirdness of gettext, but I never found
one that seemed really great.
I think in the past, given that the system we already have, we considered
whether we should just turn the MSGTR stuff into enums and use that to just
get the translated strings via trivial array lookup, but it’s also not that
great (and breaks the string format checking, though maybe that would be
possible to still work around).


More information about the MPlayer-dev-eng mailing list