Re: new work on HTML::Template
Clément OUDOT <[email protected]> Fri, 8 Apr 2011 10:44:30 +0200
| Newsgroups | gmane.comp.lang.perl.modules.html-template |
|---|---|
| Message-ID | <[email protected]> |
Le 7 avril 2011 15:39, Michael Peters <[email protected]> a =E9crit : > On 04/07/2011 03:42 AM, Cl=E9ment OUDOT wrote: > >> We develop a special filter, called translate_template, that allows to >> define<lang> =A0markup 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: > > =A0<tmpl_lang Please press the button> > > And the preprocessor will translate that into all of the supported langua= ges > 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 templat= es > 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 Kra= ng > 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=E9ment. ---------------------------------------------------------------------------= --- Xperia(TM) PLAY It's a major breakthrough. An authentic gaming smartphone on the nation's most reliable network. And it wants your games. http://p.sf.net/sfu/verizon-sfdev