On Friday, March 25, 2011 3:55:18 PM UTC-4, Joshua Bronson wrote:
>
> Hey Jinja list,
>
> I just noticed that I could be using trans tags instead of explicitly
> calling gettext in my Jinja templates. Then I thought about something like
> the following case:
>
> {{ _('Check out the <a href="/docs">docs</a>.') | safe }}
>
> Explicitly calling gettext means I can easily put a filter on the
> expression, specifically "safe" in this case, so that the markup in the
> expression is not escaped. This wouldn't work as nicely using trans tags
> instead. Is this an indication that putting markup inside a translatable
> string is bad practice? What's the best practice in this case?
>
Just asked Armin about this in #pocoo and putting markup inside trans tags
should not be resulting in the markup being escaped in the messages pybabel
extracts. Opened a bug <https://github.com/mitsuhiko/jinja2/issues/25> by
request.
--
You received this message because you are subscribed to the Google Groups
"pocoo-libs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/pocoo-libs?hl=en.