Hello ptxdist developers,

in a self written C program I want to use translated messages with locales
and gettext. My test code works well on x86 (Ubuntu Lucid) and it also
compiles and installs well with ptxdist. However on the target system,
every call of the C function 'setlocale' fails and returns NULL. locales
are activated, see:

% grep -i locale configs/ptxconfig
PTXCONF_HOST_LOCALEDEF=y
# Core (libc, locales)
PTXCONF_GLIBC_I18N_BIN_LOCALE=y
# PTXCONF_GLIBC_I18N_BIN_LOCALEDEF is not set
PTXCONF_LOCALES=y
PTXCONF_LOCALES_EN_US=y
# PTXCONF_LOCALES_EN_GB is not set
# PTXCONF_LOCALES_EN_GB_EURO is not set
# PTXCONF_LOCALES_DE_DE is not set
PTXCONF_LOCALES_DE_DE_EURO=y
# PTXCONF_LOCALES_ZH_CN is not set
# PTXCONF_LOCALES_ZH_CN_GBK is not set
# PTXCONF_LOCALES_ZH_CN_GB18030 is not set
# PTXCONF_LOCALES_ZH_TW is not set
# PTXCONF_LOCALES_ZH_HK is not set
# PTXCONF_BUSYBOX_LOCALE_SUPPORT is not set
# Core (Kernel, libc, locales)

If I open a shell on the target system and type 'locale -a' I get this:

C
POSIX
de_DE.iso885915@euro
de_DE@euro
en_US
en_US.iso88591

So it seems locales are installed. I tried setlocale with the de_DE
variants of the above strings and even with 'de_DE' only, none of them
works.

I just checked my header file again for the arguments which are used in my
calls to bindtextdomain() and textdomain() (see gettext documentation) and
these arguments match the package name and path on the target system, the
.mo file seems in the right place at
/usr/local/share/locale/de/LC_MESSAGES

A call to perror directly after the failing setlocale( LC_ALL,
"de_DE@euro" ) gives the following on stdout: "No such file or directory"
-- I double checked errno before the call, this comes from setlocale. What
file is it looking for?

Can anyone give me a hint how to debug this? Am I missing some package? Is
the setlocale call correct?

One strange thing I came across: although locales are activated, none of
the other packages makes use of it, there are no files in
/usr/share/locale/de for example. How come?

Greets
Alex

P.S.: thanks for your answer on the cmake topic, I'll reply to that tomorrow.


-- 
ptxdist mailing list
ptxdist@pengutronix.de

Reply via email to