[pygtk] gettext and glade

Mattias Nilsson mattias.nilsson@privat.utfors.se
Tue, 18 Jul 2000 20:16:15 +0200


Hi.
Is there a way to use gettext with libglade (glade) without  fetching
every "object" that needs to be translated?

If I do as in the code below there will be a lot of labels and stuff to
fetch, (but I'm probably just  lazy) one could hope for a more "magic"
way to do it...
(I have figured out how to get gettext to work)

-------------------------------------
_ = gettext.gettext
gettext.bindtextdomain("test","/usr/share/locale")
gettext.textdomain("test")

widgets = libglade.GladeXML('test.glade')
mainwindow = widgets.get_widget('main_window')
mainwindow.connect('delete_event',mainquit)

label_hello = widgets.get_widget('label_hello')
label_hello_string = _("Hello")
label_hello.set_text(label_hello_string)
-----------------------------------
Thanks
Mattias Nilsson
mattias.nilsson@privat.utfors.se

I