[issue18217] Deprecate and remove gettext.install

R. David Murray report at bugs.python.org
Fri Jun 14 23:43:59 CEST 2013


R. David Murray added the comment:

install says this:

    This installs the function _() in Python’s builtins namespace, based on domain, localedir, and codeset which are passed to the function translation()

Unless I'm misunderstanding something, this means that the actual value of _ is different depending on which domain, localedir, and codeset are in use.  So if my application allows the user to *change languages* at runtime, I need to *change* what is bound to _.  If my program has assigned a value to _, when another part of the application changes the language, what is bound to _ in other modules is not going to change.  This is my understanding of why _ is put in the global namespace.

Of course, I've only used gettext in one application (that did dynamic language switching), so I could just have been doing it wrong...and I suppose there is no reason (and some sense) why _ could not be a function that indirects to the current language.  Or is that the way it works now and I am just misunderstanding the documentation?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue18217>
_______________________________________


More information about the Python-bugs-list mailing list