#2180: Messages translated lazily are not extracted by default
------------------------+---------------------------------------------------
Reporter: Gustavo | Owner: faide
Type: defect | Status: closed
Priority: high | Milestone: 2.0b6
Component: TurboGears | Version: trunk
Severity: normal | Resolution: fixed
Keywords: i18n, l10n |
------------------------+---------------------------------------------------
Comment (by Gustavo):
Replying to [comment:1 mramm]:
> Is there something that needs to be changed in the tg project's
quickstart template, or in Pylons, or is this just something that just
needs to be documented?
A quick solution is to add that switch in the setup.cfg file of the
quickstarted application once #2179 gets fixed with lazy translations.
Also documenting it may be useful for some people.
> I note that the pylons docs stress the avoidance of lazy_gettext where
possible. Seems like this is needed for repoze.what, do we need it
anywhere else?
By default, only in repoze.what predicates because in TurboGears they are
defined at module level and shared among threads. The only way we can
avoid it in multilingual websites work-around would be to define it inside
the controller action:
{{{
@expose(...)
def my_action(self, param):
not_anonymous(msg=_('This message *will* get
translated')).check_authorization(environ)
pass
# instead of the traditional:
@expose(...)
@require(not_anonymous(msg=_('This message will not get translated')))
def my_action(self, param):
pass
}}}
... a rather ugly solution.
Option C will be do nothing and just document this issue for people who
are creating a multilingual website and want authorization denial messages
to be translatable.
--
Ticket URL: <http://trac.turbogears.org/ticket/2180#comment:2>
TurboGears <http://www.turbogears.org/>
TurboGears front-to-back web development
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "TurboGears Tickets" group.
This group is read-only. No posting by normal members allowed.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/turbogears-tickets?hl=en?hl=en
-~----------~----~----~----~------~----~------~--~---