3 if(! class_exists('App')) {
5 public $strings = Array();
11 print "Usage: ".$argv[0]." <strings.php>\n\n";
16 $pofile = dirname($phpfile)."/messages.po";
18 if (!file_exists($phpfile)){
19 print "Unable to find '$phpfile'\n";
23 include_once($phpfile);
25 print "Out to '$pofile'\n";
28 $infile = file($pofile);
31 foreach ($infile as $l) {
33 if ($k!="" && substr($l,0,7)=="msgstr "){
36 //echo "DBG: k:'$k'\n";
37 if (isset($a->strings[$k])) {
38 $v= '"'.$a->strings[$k].'"';
40 //var_dump($k, $v, $a->strings[$k], $v);
44 //echo "DBG: v:'$v'\n";
45 $l = "msgstr ".$v."\n";
48 if (substr($l,0,6)=="msgid_" || substr($l,0,7)=="msgstr[" )$ink = False;;
51 $k .= trim($l,"\"\r\n");
52 $k = str_replace('\"','"',$k);
55 if (substr($l,0,6)=="msgid "){
57 $k = str_replace("msgid ","",$l);
59 $k = trim($k,"\"\r\n");
60 $k = str_replace('\"','"',$k);
70 file_put_contents($pofile, $out);