Re: [htmltmpl] new work on HTML::Template
Brought to you by:
samtregar
From: Clément O. <cle...@gm...> - 2011-04-08 08:44:36
|
Le 7 avril 2011 15:39, Michael Peters <mp...@pl...> a écrit : > On 04/07/2011 03:42 AM, Clément OUDOT wrote: > >> We develop a special filter, called translate_template, that allows to >> define<lang> markup in the template with translations. When the >> filter run, it only keep the translation of the user language. With >> this, we have internationalized templates. > > We actually do something very similar in the Krang project. i18n is > accomplished with <tmpl_lang> tags like so: > > <tmpl_lang Please press the button> > > And the preprocessor will translate that into all of the supported languages > and then it saves those translated templates to the file system. > >> Maybe we can try to include this feature in H::T core module? > > Honestly I don't think it's the right place. As you can see from my > explanation above, there are lots of ways to do i18n. Also, as you can see > we didn't want to take the hit at runtime so we pre-translate all templates > at application startup and thus don't have to ever do it again until > something changes and we then have to restart. > > I could see releasing either your filter approach, or the approach by Krang > as separate modules onto CPAN, but not general enough for H::T > A separate module can be fine! Another feature request: would it be possible to use a var name in an include tag? The goal is to include a template whose name is the value of a var. Does someone already do such a thing? Clément. |