Hello,
That was totally the problem!

I would like to be able to keep the translation ability for the variables, is there any way to use a filter on the text before it goes into blocktrans?
I tried doing something like:

my_app/templatetags/module.py
from django import template
register = template.Library()

my_theme/templates/index.html
{% load shortcodes %}
...
{% block main|test_filter %}
{% blocktrans %}
<h2>My text!</h2>
<p>I like flowers, apples, flowers, oranges, flowers and flowers!</p>
{% endblocktrans %}
{% endblock %}

and nothing shows up on the page...
I've already got a filter I am using for richtext, so I'll just transfer that over if I can.

Other question, if I'm not to use html tags in the translated area, what do I use? Do I just put a whole lot of blocktrans tags in my html tags?
Thanks,

Brandon Keith Biggs <http://www.brandonkeithbiggs.com/>
On 7/16/2015 1:18 AM, Eduardo Rivas wrote:
That should work without issue, though I generally like to bundle all the "as" tags on top of the block.

{% block main %}
{% get_sitewide_content as sitewide %}
<h1>my text</h1>
{{ sitewide.foobar }}
{% endblock %}

Also, be careful with the blocktrans tag, you need to explicitly bind any variable you want to use inside them. You should also avoid including HTML tags inside them to prevent poluting the gettext catalog with markup https://docs.djangoproject.com/en/1.7/topics/i18n/translation/#blocktrans-template-tag.


--
You received this message because you are subscribed to the Google Groups "Mezzanine 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to