get i18n strings from tpls
authorx2000habouzit <x2000habouzit>
Sun, 19 Sep 2004 18:21:19 +0000 (18:21 +0000)
committerx2000habouzit <x2000habouzit>
Sun, 19 Sep 2004 18:21:19 +0000 (18:21 +0000)
scripts/devel/tplgettext.php [new file with mode: 0755]

diff --git a/scripts/devel/tplgettext.php b/scripts/devel/tplgettext.php
new file mode 100755 (executable)
index 0000000..73c73a2
--- /dev/null
@@ -0,0 +1,16 @@
+<?php
+    foreach($argv as $file) {
+       $fp = fopen($file,'r');
+       $fc = fread($fp,filesize($file));
+       fclose($fp);
+
+       preg_match_all('!(""".*?""")!s', $fc, $res);
+       if(count($res[1])) {
+           $fp = fopen($file.'.py','w');
+           foreach($res[1] as $l) {
+               fwrite($fp,'_('.stripslashes($l).")\n");
+           }
+           fclose($fp);
+       }
+    }
+?>