Hallöchen!
This is not about where to use ugettext/ugettext_lazy. I know
that. :-)
But I was fed up with all those "_ = ugettext" scattered in my code
and tried to find a more systematic approach. The following test
program runs through:
ugettext = lambda x: x
ugettext_lazy = lambda x: x
_ = ugettext_lazy
def function():
assert _ == ugettext
class A(object):
assert _ == ugettext_lazy
def method(self):
assert _ == ugettext
assert _ == ugettext_lazy
assert _ == ugettext_lazy
def function_b():
assert _ == ugettext
_ = ugettext
function()
function_b()
a = A()
a.method()
Do you think this is a good idea? Simply setting _ to
ugetttext_lazy at the beginning of a module and to ugettext at the
end (and dealing with the very few remaining exceptions)? How do
you do that?
Tschö,
Torsten.
--
Torsten Bronger Jabber ID:
torsten...@jabber.rwth-aachen.de
or
http://bronger-jmp.appspot.com