On Wednesday, February 23, 2011 02:22:47 am galago wrote:
> I need to skip translating some content from the string in template.
> I want to make something like this:
> 
> I pass the tag variable to the temaplte. Then I want to make a string: Tag:
> tag_variable. I need it to be in trans block, but only first word (Tag)
> must be translated. In other words - I need to skip translating the
> variable content and do translation only to string given directly in '..'

...
{% comment %}
        end the current trans block to handle special case
{% endcomment %}
{% endblocktrans %}
(% trans Tag: %} {{ myvar }}
{% comment %}
        start trans block  again
{% endcomment %}
{% blocktrans %}
....

or (wrap with the same blocktrans/endblocktrans as above)

{% if myvar %}
        {% trans Tag: %} {{ myvar }}
{% else %}
        {% blocktrans %}
                Tag: ..
        {% endblock %}
{% endif %}

Neither of these forms fit your needs? 

Mike



-- 
/* we have tried to make this normal case as abnormal as possible */
             -- Larry Wall in cmd.c from the perl source code

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to