2015-08-23 22:38:18 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
$arr = array();
|
|
|
|
|
|
|
|
$files = array('index.php','boot.php');
|
|
|
|
$files = array_merge($files,glob('mod/*'),glob('include/*'),glob('addon/*/*'));
|
|
|
|
|
|
|
|
|
|
|
|
foreach($files as $file) {
|
|
|
|
$str = file_get_contents($file);
|
|
|
|
|
|
|
|
$pat = '| t\(([^\)]*)\)|';
|
|
|
|
$patt = '| tt\(([^\)]*)\)|';
|
|
|
|
|
|
|
|
preg_match_all($pat,$str,$matches);
|
|
|
|
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 = '<?php' . "\n";
|
|
|
|
$s .= '
|
|
|
|
function string_plural_select($n){
|
|
|
|
return ($n != 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
';
|
|
|
|
|
|
|
|
foreach($arr as $a) {
|
|
|
|
if (is_array($a)){
|
|
|
|
if(substr($a[1],0,1) == '$')
|
|
|
|
continue;
|
2016-04-17 16:29:18 +02:00
|
|
|
$s .= 'App::$strings[' . $a[0] . "] = array(\n";
|
2015-08-23 22:38:18 +02:00
|
|
|
$s .= "\t0 => ". $a[0]. ",\n";
|
|
|
|
$s .= "\t1 => ". $a[1]. ",\n";
|
|
|
|
$s .= ");\n";
|
|
|
|
} else {
|
|
|
|
if(substr($a,0,1) == '$')
|
|
|
|
continue;
|
2016-04-17 16:29:18 +02:00
|
|
|
$s .= 'App::$strings[' . $a . '] = '. $a . ';' . "\n";
|
2015-08-23 22:38:18 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$zones = timezone_identifiers_list();
|
|
|
|
foreach($zones as $zone)
|
2016-04-17 16:29:18 +02:00
|
|
|
$s .= 'App::$strings[\'' . $zone . '\'] = \'' . $zone . '\';' . "\n";
|
2015-08-23 22:38:18 +02:00
|
|
|
|
|
|
|
echo $s;
|