X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=util%2Fextract.php;h=90127f3c1b2e4811108ed85c62a53027eb638e8c;hb=00cb7f9efb4826a6ad5c0791f26bc5e8db644f77;hp=92ec8501cef4913826d2326a0d5fc45ddcc26e7a;hpb=33037754d80dce07e6d806b6cee6df56311bb954;p=friendica.git diff --git a/util/extract.php b/util/extract.php index 92ec8501ce..90127f3c1b 100644 --- a/util/extract.php +++ b/util/extract.php @@ -10,25 +10,50 @@ $str = file_get_contents($file); $pat = '| t\(([^\)]*)\)|'; + $patt = '| tt\(([^\)]*)\)|'; preg_match_all($pat,$str,$matches); - - if(! count($matches)) - continue; - - foreach($matches[1] as $match) { - if(! in_array($match,$arr)) - $arr[] = $match; + preg_match_all($patt, $str, $matchestt); + + + if(count($matches)){ + foreach($matches[1] as $match) { + if(! in_array($match,$arr)) + $arr[] = $match; + } + } + if(count($matchestt)){ + foreach($matchestt[1] as $match) { + $matchtkns = preg_split("|[ \t\r\n]*,[ \t\r\n]*|",$match); + if (count($matchtkns)==3 && !in_array($matchtkns,$arr)){ + $arr[] = $matchtkns; + } + } } } $s = 'strings[' . $a . '] = ' . $a . ';' . "\n"; +'; + + foreach($arr as $a) { + if (is_array($a)){ + if(substr($a[1],0,1) == '$') + continue; + $s .= '$a->strings[' . $a[0] . "] = array(\n"; + $s .= "\t0 => ". $a[0]. ",\n"; + $s .= "\t1 => ". $a[1]. ",\n"; + $s .= ");\n"; + } else { + if(substr($a,0,1) == '$') + continue; + $s .= '$a->strings[' . $a . '] = '. $a . ';' . "\n"; + } } $zones = timezone_identifiers_list();