Re: Gettext



Tristan Van Berkom escribió:
Matias Torres wrote:

Hi all!
Yes, I know it's not a GTK question but i couldn't find an answer to my problem.

After building my application (if it helps, it uses gtk), i use gettext for translating it, and, in linux it works just fine. But, talking about windows, well .. it doesn't..

Note: Gtk Widgets DO translate, but the my own text doesn't.

This is what i do:
   ......
#include <gtk/gtk/h>
#include <libintl.h>
   ......
#define PACKAGE "xiliunsystem"
#define LOCALEDIR "po"
   ......
void nls_init (void)
{
   /* SHOULD I CALL gtk_set_locales(), WHERE?  */
   setlocale (LC_ALL, "");
   bindtextdomain (PACKAGE, LOCALEDIR);
   textdomain (PACKAGE);
   bind_textdomain_codeset (PACKAGE, "UTF-8");
}

int main ( ... )
{
   nls_init ();
   gtk_init (&argc, &argv);
   ....
   return 0;
}


The message catalogs are in a subfolder in the main app dir called po which looks something like this:

myAppDir/po/es/LC_MESSAGES/

In there there's a myapp.mo file compile with "msgfmt.EXE"

Does anybody knows what's wrong or run into this problem?

Please, Thanks and I'm sorry I'm sorry I'm sorry I'm sorry I'm sorry i konw it's not a gtk question.
A wild guess - maybe #include <glib-i18n.h> ?

also, is all that stuff in nls_init() really needed ?

Cheers,
                          -Tristan





Well i found out what was happening. For initializing the gettext macros i used the archive that glades generates under the name of "support.h" with ONLY the gettext macros thought i did not use glade. I don not compile the traditional way (./configure make) when trying to port to windows because of many many problems but i compile the traditional traditional and more traditional way:

mingw-gcc CFLAGS ...SOURCES.... MANYLIBS(godbless pkg-config)

Because of this the ENABLE_NLS enviroment variable wasn't set when i try to build the sources.

Hope it helps someone. To that someone: LEARN TO USE AUTOCONF because i didn't and it can make you wish the computer explotes. Thanks to all again, good bye!



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