Hi,
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 !