my ($self, $text) = @_;
while ($text =~ s/<(h[1-6]|p|td|th|title|input|span|li|_)[^>]*>(.*?)<\/\1>//s) {
- my $text = $2;
- $text =~ s/\n/\\n"\n"/g;
- $text =~ s/(.)"(?!\n)/$1\\"/g;
+ my $id = $2;
+ next if $id =~ /^\s*$/;
+ $id =~ s/\n/\\n"\n"/g;
+ $id =~ s/(.)"(?!\n)/$1\\"/g;
- print "msgid \"$text\"\n";
+ print "msgid \"$id\"\n";
print "msgstr \"\"\n";
print "\n";
}
--- /dev/null
+#! /bin/sh
+
+set -e
+
+rm -f templates/*.pot
+for FILE in templates/*.tmpl; do
+ perl -I../intl ../intl/make-pot.pl $FILE > $FILE.pot
+done
+
+msgcat templates/*.pot > po/templates.pot
+rm -f templates/*.pot
+
EOF
my $eaten = '';
-$template->process($ARGV[0], $vars, \$eaten)
-or die $template->error();
+$template->process($ARGV[0], $vars, \$eaten);
+# or die $template->error(); # errors don't really matter
+
+print "# eof\n";