I’m working on a simple python based system that sends a verification email to users.
We have users from all over the planet, thus would like to use a localized email template.
What is the pythonic approach to do this?
I thought about just having each email template in a separate file, and load it up based on the localized request, buuuuuuuuut I want to find out if there is a mo betta approach (or even more ideally a lib that I can just make use of).
You might want to checkout the gettext module for handling language translations of bits of text if you have very complex templates: that would be the Pythonic solution there.
http://docs.python.org/library/gettext.html
You might also want to check out the locale module.
http://www.doughellmann.com/PyMOTW/locale/
http://docs.python.org/dev/library/locale.html