Django allauth translations not recognized

1.4k views Asked by At

I am using Django allauth and strings marked for translation in views and forms do not appear in the .po file after running makemessages.

For example, in site-packages/allauth/account/forms.py:

from django.utils.translation import ugettext_lazy as _, ugettext
...
error = _("The username and/or password you specified are"
          " not correct.")

Also I am using rosetta for translations but allauth does not appear in list of 3rd party apps.

Any idea on why might makemessages and rosetta are ignoring allauth for translation?

2

There are 2 answers

1
pennersr On BEST ANSWER

Checkout https://docs.djangoproject.com/en/dev/topics/i18n/translation/#message-files -- specifically the note about running makemessages from the app dir. allauth has its own locale dir which is why its strings don't show in your project level locale directory. Try running makemessages on allauth level ...

0
Özer On

Also keep in mind, the translation files of all-auth sometimes is quite messed up. Check it in the repo, it may be that some strings are fuzzy or similar in your language. In that case, I copied the templates and emails and translated the manually by copying and pasting the .po file in the all-auth repository. It takes a bit of effort, but works.