X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=util%2Fextract.php;h=90127f3c1b2e4811108ed85c62a53027eb638e8c;hb=1f58bcc114928a5a3cd97bd0de34a5aa7d585931;hp=3eb332d4f5acb0c56dade3a596f658c558347514;hpb=720e7d6034abf216a444bf44b3965db067a3ef49;p=friendica.git diff --git a/util/extract.php b/util/extract.php index 3eb332d4f5..90127f3c1b 100644 --- a/util/extract.php +++ b/util/extract.php @@ -6,7 +6,7 @@ $files = array_merge($files,glob('mod/*'),glob('include/*'),glob('addon/*/*')); - foreach ($files as $file) { + foreach($files as $file) { $str = file_get_contents($file); $pat = '| t\(([^\)]*)\)|'; @@ -16,14 +16,14 @@ preg_match_all($patt, $str, $matchestt); - if (count($matches)){ - foreach ($matches[1] as $match) { - if (! in_array($match,$arr)) + if(count($matches)){ + foreach($matches[1] as $match) { + if(! in_array($match,$arr)) $arr[] = $match; } } - if (count($matchestt)){ - foreach ($matchestt[1] as $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; @@ -41,26 +41,23 @@ function string_plural_select($n){ '; - foreach ($arr as $a) { + foreach($arr as $a) { if (is_array($a)){ - if (substr($a[1],0,1) == '$') { + 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; - } + if(substr($a,0,1) == '$') + continue; $s .= '$a->strings[' . $a . '] = '. $a . ';' . "\n"; } } $zones = timezone_identifiers_list(); - foreach ($zones as $zone) { + foreach($zones as $zone) $s .= '$a->strings[\'' . $zone . '\'] = \'' . $zone . '\';' . "\n"; - } - + echo $s; \ No newline at end of file