https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93840

Roland Illig <roland.illig at gmx dot de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #2 from Roland Illig <roland.illig at gmx dot de> ---
$ grep -wr ENABLE_NLS . | grep h:
./build-x86_64-pc-linux-gnu/libcpp/config.h:/* #undef ENABLE_NLS */
./gcc/auto-host.h:#define ENABLE_NLS 1
./intl/config.h:#define ENABLE_NLS 1
./libcpp/config.h:#define ENABLE_NLS 1

ltrace says:
bindtextdomain("gcc", "/home/rillig/tmp/gcc10/share/locale") =
"/home/rillig/tmp/gcc10/share/locale"

objdump -t says:
bindtextdomain@@GLIBC_2.2.5

I wonder why the openat calls don't ever mention "gcc.mo". There's also no
readdirat anywhere near, therefore I could not explain how gettext would even
find the translations.

I quickly wrote a test program, and that program confirms that it's the GNU C
Library and its libintl that behaves strange. Without setting LC_ALL or
LC_MESSAGES, it correctly searches in the path given to bindtextdomain. But
when LC_MESSAGES is set, only /usr/lib/locale is searched, and the .mo files
are not even touched.

#include <libintl.h>
#include <locale.h>
#include <stdlib.h>
#include <stdio.h>

int main(void)
{
    setlocale(LC_ALL, "");
    bindtextdomain("gcc", "/home/rillig/tmp/gcc10/share/locale");
    textdomain("gcc");
    setlocale(LC_ALL, "");
    puts(gettext(""));
}

In the end, I just did a "ln -s de en" in locale/share, and now I can test my
German translation.

Thanks for your help.

Reply via email to