[gnome-love] How use GNOME/GTK+ Internacionalization stuff ?
- From: Fernando Alencar Maróstica <famarost unimep br>
- To: gnome-list gnome org
- Cc: gnome-love gnome org
- Subject: [gnome-love] How use GNOME/GTK+ Internacionalization stuff ?
- Date: 04 Dec 2002 13:34:52 -0200
hello all !!
I need use internacionalization on my gnome/gtk app. I use
glade for build my Interfaces, and liblade for load.
I want internacionalization this code:
#include <glib.h>
#include <gnome.h>
#include <glade/glade.h>
#include <strings.h>
#define BLACKDOLPHIN_GLADEDIR "projeto1.glade"
#define VERSION "1.0.0"
#define PACKAGE "blackdolphin"
#define PACKAGE_LOCALE_DIR "/usr/share/local/locale"
void
add_item(GtkWidget *w)
{
g_print ("add item press\n");
}
void
close_window(GtkWidget *w)
{
gtk_main_quit();
}
int main (int argc, char *argv[]) {
GladeXML *gui;
GtkWidget *cmdAdd;
GtkWidget *cmdClose;
gnome_init ("Black Dolphin", VERSION, argc, argv);
glade_gnome_init();
gui = glade_xml_new (BLACKDOLPHIN_GLADEDIR, "campocontrole");
bindtextdomain (PACKAGE, PACKAGE_LOCALE_DIR);
textdomain (PACKAGE);
if (!gui) {
g_warning ("We could not load the interface!");
return 1;
}
app = glade_xml_get_widget (gui, "campocontrole");
/*
* INTERNACIONALIZATION HERE !!
*/
cmdAdd = glade_xml_get_widget (gui, "lblOptionPosition");
gtk_label_set_text (GTK_LABEL(cmdAdd), _("Field Positions"));
cmdClose = glade_xml_get_widget (gui, "lblFieldPosition");
gtk_label_set_text (GTK_LABEL(cmdClose), _("Options Position"));
glade_xml_signal_autoconnect (gui)
gtk_object_unref (GTK_OBJECT (gui));
gtk_main ();
return 0;
}
How internacionalize this code ? I need add more C headers?
#include <libintl.h>, <locale.h> or <lignome/gnome-i18n.h> ?
When compile this code, i receive this Warnings:
fmarostica nitrogenium:/blackdolphin-1.0.0/src$ make
gcc -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/include/gtk-1.2
-I/usr/include/glib-1.2 -I/usr/lib/glib/include -I/usr/X11R6/include
-I/usr/include/gnome-1.0 -DNEED_GNOMESUPPORT_H
-I/usr/lib/gnome-libs/include -I/usr/include/glib-1.2
-I/usr/lib/glib/include -I/usr/include/orbit-1.0 -I/usr/include/gtk-1.2
-I/usr/X11R6/include -I/usr/include/libglade-1.0
-I/usr/include/gtk-1.2 -I/usr/include/glib-1.2 -I/usr/lib/glib/include
-I/usr/X11R6/include -g -O2 -Wall -Wunused -c blackdolphin.c
blackdolphin.c: In function `main':
blackdolphin.c:49: warning: statement with no effect
blackdolphin.c:50: warning: statement with no effect
/bin/sh ../libtool --mode=link gcc -g -O2 -Wall -Wunused -o
blackdolphin blackdolphin.o -lSM -lICE -L/usr/lib -L/usr/X11R6/lib
-lgtk -lgdk -rdynamic -lgmodule -lglib -ldl -lXi -lXext -lX11 -lm
-rdynamic -L/usr/lib -L/usr/X11R6/lib -rdynamic -lgnomeui
-lart_lgpl
-lgdk_imlib -lSM -lICE -lgtk -lgdk -lgmodule -ldl -lXi -lXext -lX11
-lgnome -lgnomesupport -lesd -laudiofile -lm -ldb-3 -lglib
-rdynamic
-lglade-gnome -lglade -lxml -lz -lgnomeui -lart_lgpl -lgdk_imlib -lSM
-lICE -lgtk -lgdk -lgmodule -ldl -lXi -lXext -lX11 -lgnome
-lgnomesupport -lesd -laudiofile -lm -ldb-3 -lglib
gcc -g -O2 -Wall -Wunused -o blackdolphin blackdolphin.o -rdynamic
-rdynamic -rdynamic -rdynamic -L/usr/lib -L/usr/X11R6/lib
/usr/lib/libglade-gnome.so /usr/lib/libglade.so /usr/lib/libxml.so
/usr/lib/libgnomeui.so /usr/lib/libart_lgpl.so /usr/lib/libgdk_imlib.so
/usr/lib/libjpeg.so -ltiff -lungif -lpng -lSM -lICE /usr/lib/libgtk.so
/usr/lib/libgdk.so /usr/lib/libgmodule.so -ldl -lXi -lXext -lX11
/usr/lib/libgnome.so /usr/lib/libgnomesupport.so -lz /usr/lib/libesd.so
/usr/lib/libaudiofile.so -lm -ldb-3 /usr/lib/libglib.so
Best Regards.
--
Fernando Alencar Maróstica
Graduate Student, Computer Science
Linux Register User Id #281457
University Methodist of Piracicaba
Departament of Computer Science
email: famarost unimep br
homepage: http://www.unimep.br/~famarost
[Date Prev][
Date Next] [Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]