I am trying to setup translations for emails with django-allauth.
I have rewritten my templates, translated my .po files and complied them.
The html translations work fine but for some reason just the emails don't get translated.
I have properly configured translations following the django tutorial
https://docs.djangoproject.com/en/1.10/topics/i18n/translation/#how-django-discovers-language-preference
The related question doesn't help: How does email translation work with django allauth?
Package versions:
Django==1.10
django-allauth==0.27.0
I had the same problem with django-allauth==0.32.0
and Django==1.11.1
. Translations that are shipped with allauth
are simply outdated or incomplete. In my project, for example, an email with a link to reset the password was always in English (in default language LANGUAGE_CODE = 'en'
) although the user set the language to Czech.
In .po
file for Czech translations: https://github.com/pennersr/django-allauth/blob/master/allauth/locale/cs/LC_MESSAGES/django.po#L408 is this e-mail translation marked as fuzzy
– so translations are not used. The same applies to other languages I've checked (de
, es
...).
The reason is explained in this comment from the author of allauth
:
The allauth templates are merely meant as a starting point, something to get you going quickly. Hence, I do not treat issues in the translations as blocking for release, which can result in translations getting left behind. Feel free to submit pull requests to fill in the gaps.
Source: https://github.com/pennersr/django-allauth/issues/1113#issuecomment-141189606
I think there are two ways to solve this issue:
allauth
to your project, make your own *.po
files and ignore all default translations/templates. Do not forget that e-mail templates are in *.txt
so you must call makemessages
this way: python manage.py makemessages ... --extension html,txt,py
.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With