epic-ts
[kivitendo-erp.git] / scripts / pl2tmpl.pl
1 #!/usr/local/bin/perl -pli.orig
2
3 #
4 # perlcode -> template converter
5 #
6 # there's ugly perl generated html in your xy.pl?
7 # no problem. copy&paste it into a separate html file, remove 'qq|' and '|;' and use this script to fix most of the rest.
8 #
9 # use: perl pl2tmpl.pl <file>
10 #
11 # will save the original file as file.orig
12 #
13
14 s/\$form->\{(?:"([^}]+)"|([^}]+))\}/[% $+ %]/g;
15 s/\| \s* \. \s* \$locale->text \( ' ([^']+) ' \) \s* \. \s* qq\|/<translate>$1<\/translate>/xg;
16 s/\| \s* \. \s* \$locale->text \( " ([^"]+) " \) \s* \. \s* qq\|/<translate>$1<\/translate>/xg;