[Top][All Lists]

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

[bug-gettext] Help needed with GNU gettext

From: bharathi anjeneya
Subject: [bug-gettext] Help needed with GNU gettext
Date: Mon, 6 Feb 2012 13:04:17 +0000

I am novice in Internationalization technology.
I found your article http://oriya.sarovar.org/docs/gettext_single.html.
This article was very useful for novice like me.
I am working on an assignment where I need to localise the Software written in C++ on Windows OS.
I followed the steps you mentioned. I could generate the PO files and MO files.
As an experiment, I have written Translated strings myself to some other text in english itself. And I generated the MO file and copied to the folder.C:\Program files\GnuWin32\share\locale\en\LC_MESSAGES
Here is my Source code:
int _tmain(int argc, _TCHAR* argv[])
    char buf1[100];
  //  BOOL ret = SetEnvironmentVariable(L"LANGUAGE", L"en");
    char* locale = setlocale( LC_ALL, "" );
    bindtextdomain( "TestApp1", "C:\\Program File\\Gnu Win32\\share\\locale" );
    textdomain( "TestApp1" );
    sprintf (buf1, "%d", 123);
    printf (gettext ("The amount is %s\n"), buf1);
    printf (gettext ("Hello.. How r u ?\n"), buf1);
 return 0;
Translated string in MO file looks like this:
Translated:The amount is %s\n
Translated:Hello.. How r u
After this I suppose when I execute the programs, I should be getting output as the Translated messages
Translated:The amount is %s\n
Translated:Hello.. How r u
But I am getting the original messages not Translated messages. Note that I have set the LOCALE env variable as en_GB
Please me know if I am missing any steps. What should I do to get Translated messages as output ?
Thanks a lot!
reply via email to

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