first reimport from platal
[platal.git] / bin / devel / tplgettext.php
CommitLineData
0337d704 1#!/usr/bin/php
2<?php
3 foreach($argv as $i=>$file) {
4 if($i == 0) continue;
5 $fp = fopen($file,'r');
6 $fc = fread($fp,filesize($file));
7 fclose($fp);
8
9 preg_match_all('!(""".*?""")!s', $fc, $res);
10 if(count($res[1])) {
11 $fp = fopen($file.'.py','w');
12 foreach($res[1] as $l) {
13 fwrite($fp,'_('.stripslashes($l).")\n");
14 }
15 fclose($fp);
16 }
17 }
18?>