internationalization - django translate variable content in template -


i'm using {% trans %} template tag. django docs say:

the {% trans %} template tag translates either constant string (enclosed in single or double quotes) or variable content:

{% trans "this title." %} {% trans myvar %}

https://docs.djangoproject.com/en/1.3/topics/i18n/internationalization/#trans-template-tag

i found impossible {% trans myvar %} because myvar doesn't show in django.po file after running makemessages command.

am using wrong? me this?

you can use blocktrans template tag in case:

{% blocktrans %} title: {{ myvar }} {% endblocktrans %} 

Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

java - Output of Eclipse is rubbish -

jquery - Confused with JSON data and normal data in Django ajax request -