Christian Reis wrote:

On Sat, Nov 23, 2002 at 03:30:37PM +0100, Grzegorz Adam Hankiewicz wrote:

Last time I checked the faq said something strange about not using
gettext, using intl, then using again gettext :-? So I took an
example from the pygtk directory and started hacking it until I
managed to get it working with python's gettext module. The example
is attached.

Well, the only trick is getting internationalization to work in
Python2.1 or earlier if you need to translate strings in libglade,
because libglade is run in C, and Python2.1 and earlier's gettext module
is pure python. This doesn't work well with C extensions. I'd guess
GNOME stock buttons and the like would have the same problems.

Well, the libglade wrapper in pygtk-1.99.x handles this okay. It provides a gtk.glade.bindtextdomain() call that will set up the translation domain with the C gettext library, and make sure it uses UTF-8 so that it can be used with libglade.



Can somebody check if this is ok? I see that the FAQ has been
updated, but looks like it focuses on the C part of gettext, and
this smaller example might be easier to understand for newbies. Feel
free to put it in the faq or some cvs directory.

What version of Python are you using? 2.2's gettext has changed this to
be correct again (AFAIK, from what Martin wrote me and James).

Python 2.2 also has a python-only gettext module. In Python 2.3, there will be some extra functions in the locale module for using the C level gettext library.


James.

--
Email: [EMAIL PROTECTED] | Linux.conf.au http://linux.conf.au/
WWW: http://www.daa.com.au/~james/ | Jan 22-25 Perth, Western Australia.



_______________________________________________
pygtk mailing list [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to