11 Dec 2007 14:59
r2962 - trunk/unstable/scripts
SVN author sschoeling <m.bunkus <at> linet-services.de>
2007-12-11 13:59:04 GMT
2007-12-11 13:59:04 GMT
Author: sschoeling
Date: 2007-12-11 14:59:03 +0100 (Tue, 11 Dec 2007)
New Revision: 2962
Log:
kleines Script zum konvertieren von perl html -> template html
Added:
trunk/unstable/scripts/pl2tmpl.pl
Added: trunk/unstable/scripts/pl2tmpl.pl
===================================================================
--- trunk/unstable/scripts/pl2tmpl.pl (rev 0)
+++ trunk/unstable/scripts/pl2tmpl.pl 2007-12-11 13:59:03 UTC (rev 2962)
<at> <at> -0,0 +1,15 <at> <at>
+#!/usr/local/bin/perl -pli.orig
+
+#
+# perlcode -> template converter
+#
+# there's ugly perl generated html in your xy.pl?
+# no problem. copy&paste it into a separate html file, remove 'qq|' and '|;' and use this script to fix most
of the rest.
+#
+# use: perl pl2tmpl.pl <file>
+#
+# will save the original file as file.orig
+#
+
+s/\$form->\{(?:"([^}]+)"|([^}]+))\}/[% $+ %]/g;
+s/\| \s* \. \s* \$locale->text \( ' ([^)]+) ' \) \s* \. \s* qq\|/<translate>$1<\/translate>/xg;
(Continue reading)
RSS Feed