[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Big picture of building & packaging
From: |
Bruno Haible |
Subject: |
Re: Big picture of building & packaging |
Date: |
Sun, 11 Jun 2023 23:44:27 +0200 |
Teddy wrote:
> I have been able to trace it down to the following section of code in
> msginit.c:
>
> if (setlocale (LC_ALL, "") == NULL)
> /* Nonexistent locale. Use the English title. */
> result = english;
> else
> {
> /* Fetch the translation. */
> ...
> if (result != msgid && strcmp (result, msgid) != 0)
> /* Use the English and the foreign title. */
> result = xasprintf ("%s\n%s", english, result);
> ...
>
> On OSX, in v0.21, the setlocale function call returns NULL, while it does not
> in v0.21.1.
This setlocale's declaration is in libintl.h. In the source tree, it's the
file gettext-runtime/intl/libgnuintl.in.h. In its history on the 0.21.x branch,
between 2020-07-27 and 2022-10-10, I see no relevant change. So, in both
versions, the setlocale function comes from gnulib. This is also confirmed
by looking at the .o files in a build:
$ nm ../../gettext-runtime/intl/.libs/setlocale.o | grep ' T '
0000000000000524 T _libintl_newlocale
0000000000000000 T _libintl_setlocale
$ nm ../gnulib-lib/setlocale.o | grep ' T '
0000000000000000 T _rpl_setlocale
$ nm msginit-msginit.o | grep setlocale
U _rpl_setlocale
Now, let's look at the history of gnulib/lib/setlocale.c, on the stable-202201
branch, again between 2020-07-27 and 2022-10-10. It hasn't changed at all! And
the most important dependency of this file, gnulib/lib/localename.c, also has
not changed in a way that would be relevant on macOS.
At the point where setlocale (LC_ALL, "") gets called, what are the values of
- getenv ("LC_ALL"),
- getenv ("LC_..") for all other LC_* variables,
- getenv ("LANG") ?
Bruno