2 package Sesse::ExtractGettext;
5 use Template::Directive;
7 our @ISA = qw(Template::Directive);
10 my ($self, $text) = @_;
12 while ($text =~ s/<(h[1-6]|p|td|th|title|input|span|li|option|_)[^>]*>(.*?)<\/\1>//s) {
14 next if $id =~ /^\s*$/;
15 $id =~ s/\n/\\n"\n"/g;
16 $id =~ s/(.)"(?!\n)/$1\\"/g;
18 print "msgid \"$id\"\n";
19 print "msgstr \"\"\n";
23 return $self->SUPER::textblock($text);