ec734e0f35000bce4acc4d88370dbbc6fe5df690
[ccbs] / intl / Sesse::GettextizeTemplates.pm
1
2 package Sesse::GettextizeTemplates;
3 use strict;
4 use warnings;
5 use Locale::gettext qw(gettext);
6 use Template::Directive;
7
8 our @ISA = qw(Template::Directive);
9
10 sub textblock {
11         my ($self, $text) = @_;
12
13         $text =~ s/(<(h[1-6]|p|td|th|title|input|span|li|_)[^>]*>)(.*?)(<\/\2>)/$1.gettext($3).$4/seg;
14
15         return $self->SUPER::textblock($text);
16 }
17
18
19