From c843de8a57a24930e2c04c88a0201937937710bb Mon Sep 17 00:00:00 2001 From: Sebastian Spaeth Date: Fri, 14 Dec 2012 15:16:49 +0100 Subject: [PATCH] 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... --- mediagoblin/tools/translate.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) -- 2.25.1