Reputation: 105
I'm working on an movielist interface using python, gtk+3 and glade and I want it to be in two languages. I've followed the instructions I've found on different sites, but I have a problem. I have the po file with the translation (english to spanish) but now, when it comes to adding that file with the translation to the code I run in all sort of errors.
gtk.glade.textdomain(APP)
gtk.glade.bindtextdomain(APP, DIR)
Being APP the file name and DIR the directory, but the gtk name doesn't exist and I can't import it without running into a segmentation fault error.
So, I basically need to know how to add the translation files in my pygtk code. Thank you
Upvotes: 1
Views: 87
Reputation: 2096
I believe the most popular way to Internationalize (I18N) an application is to use gettext.
https://docs.python.org/2/library/gettext.html
Wrap the strings to translate like this _(u"This text is to be translated")
A nice tool to translate strings is poEdit http://poedit.net/
Upvotes: 1