[Top][All Lists]

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

Re: GNU: Problem avec le gettext

From: Jean-Louis Tang
Subject: Re: GNU: Problem avec le gettext
Date: Mon, 08 Nov 2004 12:05:26 +0800
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040616

Hello, everyone,

   Thank you for your replies. I followed your advices but I encountered
the following issues (in blue) ( and attached what we did ):

( The original issue that we have some trouble to use the getText function. )

Please find hereafter the steps that I have done to test the GNU gettext API_ and the results:

1. create the sample program (/hello.c/)
2. create the template file (/hello.pot/) by:
   xgettext -d hello -s -o hello.pot hello.c
3. create the PO file (/chi.po/) by:
   msginit -l zh_CN.utf8 -o chi.po -i hello.pot
4. create the MO file (/hello.mo/) by:
   msgfmt -c -v -o hello.mo chi.po
5. copy the MO file to the directory LC_MESSAGES under its locale
   cp hello.mo ./zh_CN.utf8/LC_MESSAGES   *OR*
cp hello.mo ./zh_CN/LC_MESSAGES 6. set the current locale to *Chinese*
   export LANG=zh_CN.utf8

I guess my .mo file has already been put
correctly, right ?

In the main program, the second arg. for bindtextdomain is

And, I have tried to copy the .mo file to <second
arg>/zh_CN.utf8/LC_MESSAGES or <second arg>/zh_CN/LC_MESSAGES,

where zh_CN.utf8 is the locale.

7. compile the sample program

  cc -I/usr/local/share/gettext hello.c -o hello

8. execute /hello/


9. result -> *Hello* (NOT translated !)

I have tried to use 'strace' after setting the
variable LANG to zh_CN.utf8.

Here below is the result:

export LANG=zh_CN.utf8

strace 28 all all

*Message catalog can't be opened/accessed for language zh_CN.utf8.

Language C will used*.

_Conclusion:_ What should be checked in order to ensure the right message 
catalog can
be accessed ?

PS: You can reply to me in French ( I'm French if you like ): it is now in English in order to help my colleague.

Please advise
Thanks in advance

Best Regards

Attachment: getText_Issue.zip
Description: Zip compressed data

reply via email to

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