[Top][All Lists]

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

[bug-gettext] gettext don't try to open a mo file ..... why ?

From: Micka
Subject: [bug-gettext] gettext don't try to open a mo file ..... why ?
Date: Fri, 6 Jun 2014 14:29:24 +0200


I'm on Debian. I installed the package gettext .

I found the gettext.h provided by the package and I included it in my program .

I had to modify the file gettext.h, to add #define ENABLE_NLS 1 before the if.

In my mlinux c program, I included those two files :

# include <locale.h>
#include "gettext.h"

then I've done that :

acTest= setlocale(LC_ALL,"");
printf(" local: %s\n", acTest);
acTest= bindtextdomain("Alwin", LANGUAGE_DIR);
printf(" bind domain : %s\n", acTest);
acTest= textdomain("Alwin");
printf(" textdomain: %s\n", acTest);

which it works, the return value correspond of what I've entered !

Just after, I set my language with :

setenv ("LANGUAGE", acLanguage, 1);

then I try a hello world with :

acTest = gettext("hello");

... here is the problem, It doesn't work ... 

I tried this command:
sudo strace -e trace=open ./hello

I didn't find any open to the .mo file !

I looked at http://www.gnu.org/software/gettext/FAQ.html#integrating_noop

And try with gdb to find out if it will execute some function :

Breakpoint 2, textdomain ()
(gdb) continue
Breakpoint 3, bindtextdomain ()
(gdb) continue
Breakpoint 6, dcgettext ()

yes it does !

So what is my problem ? Thx !

reply via email to

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