7

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

Tomas Novotny
  • 7,547
  • 9
  • 26
  • 23

1 Answers1

4

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).

JanC
  • 1,264
  • 9
  • 6
  • I believe `intltool` knows what is translatable in the `foo.glade` file thanks to the `translatable="yes"` properties. Example: `This is my button` – Antônio Medeiros Oct 31 '21 at 19:39