Localization of GUI created using Glade and Python (Gtk)

I created an application using Glade and Python, and would like to do some localizations.

I know how to localize strings that are in Python code, I just encapsulate all strings that should be localized using _ (), and set the line feed in the .po file.

But how can I specify a line built with Glade that needs to be localizable (e.g. labels, menu items, button labels ...)?

I use gettext for localization.

Thank you Thomas

+6
python user-interface pygtk gettext glade
source share
1 answer

You can create a * .pot file from a * .glade file with intltool-extract --type=gettext/glade foo.glade , and intltool presumably knows what can be translated.

In addition, I suggest you study GtkBuilder if you haven’t done so (you can save the GtkBuilder interface files from the latest versions of Glade 3, and you will no longer need additional libglade).

+3
source share

All Articles