hi,
you can try this one:
http://perlboard.svn.sourceforge.net/viewvc/perlboard/battie/lib/HTML/Template/Compiled/Plugin/Translate.pm?view=markup
I want to make a CPAN module out of it. Hopefully soon =)
Here is an example, the comments in the module are out of date:
use HTML::Template::Compiled;
use HTML::Template::Compiled::Plugin::Translate;
my $t = <<"EOM";
<%translate id="search %1:s found %2:d videos" count=".items#" args=".search,.items#" %>
EOM
my $map = {
"search %1:s found %2:d videos" => [
q/Suche nach "%1:s" hat %2:020d Video gefunden/,
q/Suche nach "%1:s" hat %2:d Videos gefunden/,
],
};
my $plug = HTML::Template::Compiled::Plugin::Translate->new({
lang => "de",
map => $map,
});
my $htc = HTML::Template::Compiled->new(
scalarref => \$t,
plugin => [$plug],
);
$htc->param(
search => "search term",
items => [qw/ result1 result2 /],
);
print $htc->output;
The template syntax is not as short as you wanted, and I don't use gettext, but maybe you like it or can build your own plugin from this example.
regards,
tina