bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: localename: Fix gettext test failures on mingw


From: Eli Zaretskii
Subject: Re: localename: Fix gettext test failures on mingw
Date: Sat, 24 Nov 2018 09:28:53 +0200

> From: Bruno Haible <address@hidden>
> Date: Sat, 24 Nov 2018 02:16:24 +0100
> 
> Several of the GNU gettext tests fail on mingw. The reason is that
> these tests
>   - use the LOCALE_FR=French_France.1252 value found during autoconfiguration,
>   - set the LC_ALL environment variable to this value.
> The GNU gettext implementation uses
>   gl_locale_name_posix (LC_MESSAGES, "LC_MESSAGES")
> and this call returns "French_France.1252", whereas the caller - relying on
> the specification in localename.h - expects a result canonicalized to XPG
> syntax. The gettext call proceeds to look up the message catalog in
>   LOCALEDIR/French_France/LC_MESSAGES/DOMAIN.mo
> where in fact it should look in
>   LOCALEDIR/fr_FR/LC_MESSAGES/DOMAIN.mo
>   LOCALEDIR/fr/LC_MESSAGES/DOMAIN.mo
> 
> The case of the other categories, that is,
>   gl_locale_name_posix (category, categoryname)
> for category != LC_MESSAGES was already fixed by code that Eli wrote
> on 2014-07-15 and that I subsequently moved to gl_locale_name_posix
> on 2018-05-02.

LC_MESSAGES means nothing on MS-Windows, so why does Gnulib need to
"fix" something that is not supported by the runtime library?
Applications that want to be portable to MinGW and use LC_MESSAGES
should make sure the related code is either ifdef'ed out on MS-Windows
or does something reasonable "by other means".  In particular, tests
of LC_MESSAGES should probably be simply disabled on MinGW.
Proliferating the illusion that LC_MESSAGES are supported on
MS-Windows is IMO not a good idea.

> 2018-11-23  Bruno Haible  <address@hidden>
> 
>       localename: Fix gettext test failures on mingw.
>       * lib/localename.c (gl_locale_name_posix): Convert the result of
>       gl_locale_name_environ to XPG syntax.

I no longer remember the details, but wouldn't such conversion get in
the way of calling 'setlocale'?  The MS-Windows runtime library
implementation doesn't understand the XPG syntax, AFAIR, so it will
generally fail.  Which would mean applications that use this
conversion will be forever "married" to the Gnulib locale functions,
and will not be able to call Windows native functions directly, which
doesn't sound like a good idea to me, because looking up messages in a
catalog is but one small aspect of using the locale data.  Or am I
missing something?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]