Add example to the lazy gettext version to make clear when it's appropriate
I needed an example to really get when lazy_gettext would be good...
This commit is contained in:
parent
18a52dacca
commit
c843de8a57
@ -129,7 +129,10 @@ def lazy_pass_to_ugettext(*args, **kwargs):
|
|||||||
|
|
||||||
This is useful if you have to define a translation on a module
|
This is useful if you have to define a translation on a module
|
||||||
level but you need it to not translate until the time that it's
|
level but you need it to not translate until the time that it's
|
||||||
used as a string.
|
used as a string. For example, in:
|
||||||
|
def func(self, message=_('Hello boys and girls'))
|
||||||
|
|
||||||
|
you would want to use the lazy version for _.
|
||||||
"""
|
"""
|
||||||
return LazyProxy(pass_to_ugettext, *args, **kwargs)
|
return LazyProxy(pass_to_ugettext, *args, **kwargs)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user