I have some template code that looks like:
<input type='submit' value='{{ need.satisfied|yesno:"Resend this document now,Send this document now" }}' />
I'd like to be able to translate it but that appears to be difficult to accomplish.
http://code.djangoproject.com/ticket/3804 mentions
{{ _("Some String") }}
which appears to work for literal strings, but when used like
{{ _(Variable) }}
gives the error
Variables and attributes may not begin with underscores: '_'
So, how do you do it?
Oh yea, I tried doing:
'{% if blah %}{% trans "Resend..." %}{% else %}{% trans "Send..." %}{% endif %}'
which works, but look so ugly I don't want to. Surely with Django there is some more elegant way to do this.....
Seems like a |trans filter would be in order, but that was shot down as a non-issue with http://code.djangoproject.com/ticket/3804