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.

Author r.david.murray
Recipients alex, barry, r.david.murray
Date 2013-06-14.21:43:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1371246239.68.0.182748235839.issue18217@psf.upfronthosting.co.za>
In-reply-to
Content
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?
History
Date User Action Args
2013-06-14 21:43:59r.david.murraysetrecipients: + r.david.murray, barry, alex
2013-06-14 21:43:59r.david.murraysetmessageid: <1371246239.68.0.182748235839.issue18217@psf.upfronthosting.co.za>
2013-06-14 21:43:59r.david.murraylinkissue18217 messages
2013-06-14 21:43:59r.david.murraycreate