Re: localizing testtext.c

"Karunakar Guntupalli" <karunakarg hotmail com> writes:

> Hi,
> I was trying to localize testtext using gettext to create a demo for
> pango indic support.
> I
> - marked most of the strings for translation & modified sources as per
> gettext (ver 0.10.35) docs.
> - created proper config files (Makefiles, configure scripts etc)
> - compilation & installs fine, application runs
> but when i change LANG to desired one (now only es hi) the translated
> strings dont showup.
> I fiddled a lot with all files but still couldn't get it working.
> I also tried some other sample application generated through glade
> (gtk widgets only, compiled with gtk-gtkbeta-1.3.2) with same config
> stuff, it works.
> I have attached the code (just do configure & make)
> What am i missing out? or is this problem specific for gtkbeta only?
> please help

I see a couple of problems with your code:

 * You are using N_ in a lot of places that you should be
   using _. See the gettext docs for the difference between
   gettext (_) and gettext_noop (N_).

 * In order to get localization to work with GtkItemFactory,
   you need to call:

void   gtk_item_factory_set_translate_func (GtkItemFactory      *ifactory,
					    GtkTranslateFunc     func,
					    gpointer             data,
					    GtkDestroyNotify     notify);

   The callback for this:

typedef gchar * (*GtkTranslateFunc)	   (const gchar		*path,
					    gpointer             func_data);

   is responsible for calling gettext() on the path.

   (The reason things are done this way is so that you can use
   translation mechanism other than gettext with GTK+ if you so wish.)


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