I'm quite new to Django and I'm working on a project with i18n, the thing is that I have translated some variables using .manage.py makemessages / compilemessages
on my template file, but when I use {% trans "my string" %}
I got the same "my string"
for all the languages.
What am I doing wrong? Here's the code for the views.py and the idioma.html
views.py:
#some code here...
def idioma(request):
output = _("Mensaje en espanol")
return render_to_response( 'idioma/idioma.html', { 'idioma' : output }, context_instance = RequestContext(request) )
idioma.html
{% load i18n %}
< form action="/i18n/setlang/" method="post">
{% csrf_token %}
< input name="next" type="hidden" value="{{ redirect_to }}" />
< select name="language" >
{% get_language_info_list for LANGUAGES as languages %}
{% for language in languages %}
< option value="{{ language.code }}">
{{ language.name_local }} ({{ language.code }})
< /option>
{% endfor %}
</select>
< input type="submit" value="Go" />
< /form>
La cadena es: {% trans idioma %}
{% trans "carro" %}
The application translates the idioma variable from the .po and .mo files in locale/path/to/language/
But it doesn't translate the {% trans "carro" %} string.
What's going on?
Thanks for your help!!!!