Hi Antonis, I think I figured this out. I have English as fallback language (LANGUAGE_CODE = 'en') in the settings, but my source language is German, and this mismatch seems to have been the source of all the trouble. Providing German translations (even if the original strings are already in German) seems to solve the issue.
Thanks for your help in any case, Joan On Thursday, March 9, 2017 at 10:51:11 AM UTC+1, Antonis Christofides wrote: > > 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 Christofideshttp://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...@googlegroups.com <javascript:>. > To post to this group, send email to django...@googlegroups.com > <javascript:>. > 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/ff6f6461-aaba-4935-a636-8ee70e096626%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.