Re: Internationalization of GTK Apps (change language)
- From: Andreas Stricker <andreas stricker fela ch>
- To: gtk-app-devel-list gnome org
- Subject: Re: Internationalization of GTK Apps (change language)
- Date: Mon, 25 Sep 2006 12:28:28 +0200
Madhusudan E wrote:
Hi All,
I want my applications to be internationalized.
I have included in my app
#include <glib/gi18n.h>
and
I have set LC_ALL = "zh_TWBig5"
And I'm using the following way to describe my labels
gtk_label_new ( _("Exit"));
But my app is not reflecting the language changes (to Chinese).
Is there anything more to be done.
Or am I going wrong anywhere.
You need to bind the language domain somewhere during the
initialisation phase (usually in main()):
bindtextdomain(GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR);
bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
textdomain(GETTEXT_PACKAGE);
Next you need to create and install a message cataloge. This
involves to extract the translatable strings from the source
and translate it in the target languages. The gettext tools
are used for this. See*: http://www.async.com.br/~kiko/gettext.html
If you use autotools, there is intltoolize and autopoint to
initialize the build framework and update the messages.
Cheers,
Andy
* There is a good howto somewhere, but I can't find it anymore
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]