Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Localization of GUI built with Glade and Python (Gtk)

I have made an application using Glade and Python and I would like to make several localizations.

I know how to localize strings that are in the Python code, I just encapsule all the strings that are supposed to be localized with _() and than specify the translation of the string in a .po file.

But how do I tell a string that is built with Glade that it should be localizable (for example labels, menu items, button labels, ...)?

I am using gettext for the localization.

Thank you, Tomas

like image 669
Tomas Novotny Avatar asked Aug 27 '10 16:08

Tomas Novotny


1 Answers

You should be able to create a *.pot file from a *.glade file using intltool-extract --type=gettext/glade foo.glade, and intltool supposedly knows what is translatable.

Also, I suggest you look into GtkBuilder if you didn't do that already (you can save GtkBuilder interface files from recent Glade 3 versions, and you won't need the extra libglade anymore).

like image 185
JanC Avatar answered Nov 04 '22 04:11

JanC