Message191158
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? |
|
Date |
User |
Action |
Args |
2013-06-14 21:43:59 | r.david.murray | set | recipients:
+ r.david.murray, barry, alex |
2013-06-14 21:43:59 | r.david.murray | set | messageid: <1371246239.68.0.182748235839.issue18217@psf.upfronthosting.co.za> |
2013-06-14 21:43:59 | r.david.murray | link | issue18217 messages |
2013-06-14 21:43:59 | r.david.murray | create | |
|