It's very unlikely that such a basic behaviour won't work, so probably you are
doing something wrong (and so's the stack overflow poster). I made several
related changes in an app yesterday and I had absolutely no problem with {%
trans %} (but I'm using 1.8).

Do you have USE_I18N = True?

If in the template you use

  {% get_current_language as current_language %}
  <p>{{ current_language }}</p>

does it show the correct language?

Antonis Christofides
http://djangodeployment.com

On 03/09/2017 11:25 AM, Joan Perals wrote:
> This post on StackOverflow seems to report the same behaviour:
> http://stackoverflow.com/questions/10282074/how-to-set-default-language-in-django-for-templates
>
> It's quite old (almost 5 years), but remains unresolved.
> -- 
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com
> <mailto:django-users+unsubscr...@googlegroups.com>.
> To post to this group, send email to django-users@googlegroups.com
> <mailto:django-users@googlegroups.com>.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/02a7eb4a-086f-4e76-a693-3ae5623db08e%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/02a7eb4a-086f-4e76-a693-3ae5623db08e%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/31891f30-ceff-afef-3c86-97f1cc887a6e%40djangodeployment.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to