Never use _() to translate globals objects like form labels, predicate
messages, variables and so on.
They will get translated when the application loads instead of being
translated when required.

you must use l_() for such cases, replace tg.i18n.ugettext import with
tg.i18n.lazy_ugettext one


On Tue, Apr 9, 2013 at 4:46 PM, Luca Verardi <[email protected]> wrote:

>
> I upgraded the version of tgext.pluggable to 0.1.3 and when i start:
>
>   File "/home/luca/test/trunk/test/test/controllers/root.py", line 119, in
> RootController
>     @require(predicates.not_anonymous(msg=_("E' necessaria
> l'autenticazione per poter accedere")))
>   File
> "/home/luca/test/trunk/eggs/Pylons-1.0.1-py2.7.egg/pylons/i18n/translation.py",
> line 107, in ugettext
>     return pylons.translator.ugettext(value)
>   File
> "/home/luca/test/trunk/eggs/Paste-1.7.5.1-py2.7.egg/paste/registry.py",
> line 137, in __getattr__
>     return getattr(self._current_obj(), attr)
>   File
> "/home/luca/test/trunk/eggs/Paste-1.7.5.1-py2.7.egg/paste/registry.py",
> line 197, in _current_obj
>     'thread' % self.____name__)
> TypeError: No object (name: translator) has been registered for this thread
>
> I tried pylons versions 1.0 and 1.0.1, and the outcome is the same.
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "TurboGears" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/turbogears?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/turbogears?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to