Hi Bill On Thu, 2011-03-03 at 08:14 -0800, Bill Moseley wrote: > I use TT for generating email. Unlike many our our web pages where > often there are not that many strings to localize (I just use [% > loc( 'Log out' ) %]), the email templates are almost entirely text. > So, it doesn't make a lot of sense to use a loc() call around every > paragraph or sentence. > > > So, what I do instead is use the Locale::Maketext-type of approach and > set my TT include path with a list of language_country codes from > specific to less and set up a directory hierarchy of templates where I > might search templates/email/es/es_es/, templates/email/es/, and then > fallback to templates/email/en.
I actually go for the loc() around every paragraph, as often I need to include variables in the email, and the structure of those phrases vary depending on the language. eg Polish plurals have : one, few, many instead of just one and many. You get all that for free if you stick with the standard i18n approach. So, you can switch to language based templates while everything is static, but as soon as you have to introduce one of the above exceptions, you're back to using a kludge, or having your translators edit TT code. Also, using the standard loc() approach means that I don't need to do anything special to extract the text of the emails into my PO files for the translators. > clint _______________________________________________ templates mailing list [email protected] http://mail.template-toolkit.org/mailman/listinfo/templates
