From: Sebastian Spaeth Date: Fri, 14 Dec 2012 14:16:49 +0000 (+0100) Subject: Add example to the lazy gettext version to make clear when it's appropriate X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=c843de8a57a24930e2c04c88a0201937937710bb;p=mediagoblin.git 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... --- diff --git a/mediagoblin/tools/translate.py b/mediagoblin/tools/translate.py index eead6413..96144538 100644 --- a/mediagoblin/tools/translate.py +++ b/mediagoblin/tools/translate.py @@ -129,7 +129,10 @@ def lazy_pass_to_ugettext(*args, **kwargs): 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 - 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)