in reply to Re^5: send mail cgi
in thread send mail cgi
I've been using Template since 2008. It's extremely handy. And it's sort of easy enough to write your own "plugins" as well, like support for multi-language lookups in your database.
... use base qw(Template::Plugin); use Template::Plugin; use Template::Exception; sub load { my ($class, $context) = @_; my $self = bless { }, $class; return $self; } sub new { my ($self, $context) = @_; return $self; } ... sub tr { my ($self, $data) = @_; return $data if($data eq ''); my $lang = $self->getLang; my $trans = tr_translate($lang, $data); return $trans; } ...
And suddenly, you can call [% tr.tr("Hello World") %] in your Template and have your backend insert the correct klingon translation.
|
|---|