Django in a browser session translates everything fine from one language to another according to the users’ browser settings or the language they chose in their profile.
Now when sending a mail to a user (let’s say when another user leaves a comment on some content and Django automatically sends an email to the owner of the content to alert her) I don’t understand how Django knows what language to use since there is no session to look at. What is the correct way to handle that?
Django in a browser session translates everything fine from one language to another according
Share
I was given the answer on the Django users Group by Tom Evans:
the tool is
then it can be used in this scenario:
and the docs are here:
https://docs.djangoproject.com/en/dev/topics/i18n/translation/#using-translations-outside-views-and-templates