peopledoc / django-mail-factory

Django Mail Manager
Other
72 stars 17 forks source link

i18n mail templates - proposal #7

Closed cypreess closed 11 years ago

cypreess commented 11 years ago

I dont particularly like your approach for emails i18n. Having different set of templates for each language is not very "djangish". Instead of this I use with success standard django approach using {% load i18n %} and {% trans %} / {% blocktrans %} inside my e-mails templates. I found this far more convenient especially when you are working with translators. In such case all you need to translate are *.po file rather than remember to translate as well some other files.

Any way great app.

gregtap commented 11 years ago

Well in our case translating emails with po was a real pain. The overall understanding of the email is obfuscated with trans / blocktrans everywhere.

Natim commented 11 years ago

It is not an obligation actually to have different set of templates, it is just a possibility.

If you have the same mails in English and in Arabic language, your html file might not be quite the same.

I am using the i18n django solution quite often even if it sometimes kill the readability.

You might also want to select different templates regarding to the context if you want to change the html file for different customer in a SaaS environment. django-mail-factory is able to suit to your needs but most of the time you just need to extends BaseMail to get started.

magopian commented 11 years ago

Hello, and thanks for your feedback.

Indeed, the "correct" way of doing is using gettext, and it is indeed possible as explained in the documentation here : http://django-mail-factory.readthedocs.org/en/latest/template.html#mail-templatesk

The "other" way of doing is very useful in cases where the translations are made by the customer or a designer or product manager... who doesn't use or know how to use gettext (and poedit).