This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Python gettext doesn't support libglade
Type: Stage:
Components: Library (Lib) Versions: Python 2.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: jamesh, kiko_async, loewis, nobody, nshmyrev
Priority: normal Keywords:

Created on 2002-02-12 13:01 by kiko_async, last changed 2022-04-10 16:04 by admin. This issue is now closed.

Messages (8)
msg9247 - (view) Author: Christian Reis (kiko_async) Date: 2002-02-12 13:01
Libglade is a library that parses XML and generates
GTK-based UIs in runtime. It is written in C and
supports a number of languages through bindings.

James Henstridge has maintained a set of bindings for
Python for some time now. These bindings work very
well, _except for internationalization_.

The reason seems now straightforward to me. Python's
gettext.py is a pure python implementation, and because
of it, bindtextdomain/textdomain are never called. This
causes any C module that uses gettext to not activate
the support, and not use translation because of it.

Using Martin's intl.so module things work great, but it
is a problem for us having to redistribute it with our
application. Any other suggestions to fix?
msg9248 - (view) Author: Nobody/Anonymous (nobody) Date: 2002-02-12 13:52
Logged In: NO 

If what you want is a way to call bindtextdomain/textdomain
from Python, feel free to supply a patch or ask martin to
add intl.so to the distribution.

--Guido (@#$% SF always logs me out :-( )
msg9249 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2002-02-13 01:17
Logged In: YES 
user_id=21627

How does gtk invoke gettext? It sounds buggy in the respect
that it expects the textdomain to be set globally; a library
should not do that. Instead, the right thing (IMO) would be
if   gtk called dgettext, using an application-supplied
domain name. It would be then the matter of the Python gtk
wrapper to expose the GTK APIs for setting the text domain.
msg9250 - (view) Author: James Henstridge (jamesh) Date: 2002-02-13 02:15
Logged In: YES 
user_id=146903

Some libraries (libglade in this case) translate some
messages on behalf of the application (libglade translates
messages in the input file using the default translation
domain, or some other domain specified by the programmer).

This is a case of wanting python's gettext module to
cooperate with the C level gettext library.

For libglade, this could be achieved by making the
gettext.bindtextdomain() and gettext.textdomain() calls to
call the equivalent C function in addition to what they do now.

For most messages in gtk+ itself, it will use dgettext() for
most messages already, so isn't a problem.  The exception to
this is places where it allows other libraries (or the app)
to register new stock items, which get translated with a
programmer specified domain.

As of gettext 0.10.40, there should be no license problems,
as the license for the libintl library was changed from GPL
to LGPL.

It should be a fairly simple to implement this; just needs a
patch :)
msg9251 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2002-03-27 18:53
Logged In: YES 
user_id=21627

This is fixed with

configure 1.291
configure.in 1.301
pyconfig.h.in 1.25
liblocale.tex 1.28
NEWS 1.369
_localemodule.c 2.29

Notice that applications that want to change the C library's
domain bindings will have to invoke locale.bindtextdomain; I
decided not to provide automatic forwarding from
gettext.bindtextdomain to locale.bindtextdomain, since the C
library and Python may have different message catalog
formats (e.g. on Solaris); this might confuse the C library.
msg9252 - (view) Author: Shmyrev Nick (nshmyrev) Date: 2006-06-14 22:26
Logged In: YES 
user_id=598622

I am still seeing this with meld application

meld.sourceforge.net

Python 2.4.2 (#1, Feb 12 2006, 03:59:46)
[GCC 4.1.0 20060210 (Red Hat 4.1.0-0.24)] on linux2

pygtk2-devel-2.8.4-1.1
msg9253 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2006-06-15 06:03
Logged In: YES 
user_id=21627

Please don't add messages to a bug report that was closed
four years ago. Add a new bug report, explaining your
problem. Please be precise in stating what "this" is that
you are seeing.
msg9254 - (view) Author: Shmyrev Nick (nshmyrev) Date: 2006-06-24 10:00
Logged In: YES 
user_id=598622

https://sourceforge.net/tracker/index.php?func=detail&aid=1511736&group_id=5470&atid=105470
History
Date User Action Args
2022-04-10 16:04:59adminsetgithub: 36089
2002-02-12 13:01:35kiko_asynccreate