Merge branch '3.8RC'

This commit is contained in:
Mario Vavti
2018-10-19 11:18:28 +02:00
862 changed files with 98136 additions and 29195 deletions
+1 -1
View File
@@ -28,7 +28,7 @@ if($argc < 3) {
if(strpos($dstfile,'store/') === 0)
$dstfile = substr($dstfile,6);
if(strpos($dstfile,'/'))
if(strpos($dstfile,'/')) {
$nick = substr($dstfile,0,strpos($dstfile,'/'));
$dstfile = substr($dstfile,strlen($nick)+1);
}
+3108 -2831
View File
File diff suppressed because it is too large Load Diff
+73 -59
View File
@@ -7,65 +7,79 @@
}
}
if ($argc!=2) {
print "Usage: ".$argv[0]." <hstrings.php>\n\n";
return;
}
$phpfile = $argv[1];
$pofile = dirname($phpfile)."/hmessages.po";
if ($argc!=2) {
print "Usage: ".$argv[0]." <hstrings.php>\n\n";
return;
}
if (!file_exists($phpfile)){
print "Unable to find '$phpfile'\n";
return;
}
$phpfile = $argv[1];
$pofile = dirname($phpfile)."/hmessages.po";
include_once($phpfile);
if (!file_exists($phpfile)){
print "Unable to find '$phpfile'\n";
return;
}
print "Out to '$pofile'\n";
$out = "";
$infile = file($pofile);
$k="";
$ink = False;
foreach ($infile as $l) {
if ($k!="" && substr($l,0,7)=="msgstr "){
$ink = False;
$v = '';
//echo "DBG: k:'$k'\n";
if (isset(App::$strings[$k])) {
$v= App::$strings[$k];
//echo "DBG\n";
//var_dump($k, $v, App::$strings[$k], $v);
//echo "/DBG\n";
}
//echo "DBG: v:'$v'\n";
$l = "msgstr \"".str_replace('"','\"',$v)."\"\n";
}
if (substr($l,0,6)=="msgid_" || substr($l,0,7)=="msgstr[" )$ink = False;;
if ($ink) {
$k .= trim($l,"\"\r\n");
$k = str_replace('\"','"',$k);
}
if (substr($l,0,6)=="msgid "){
$arr=False;
$k = str_replace("msgid ","",$l);
if ($k != '""' ) {
$k = trim($k,"\"\r\n");
$k = str_replace('\"','"',$k);
} else {
$k = "";
}
$ink = True;
}
$out .= $l;
}
//echo $out;
file_put_contents($pofile, $out);
?>
include_once($phpfile);
print "Out to '$pofile'\n";
$out = "";
$infile = file($pofile);
$k = "";
$c = "";
$ink = False;
foreach ($infile as $l) {
$l = trim($l, " ");
if (!preg_match("/^msgstr\[[1-9]/",$l)) {
if ($k!="" && (substr($l,0,7)=="msgstr " || substr($l,0,8)=="msgstr[0")){
$ink = False;
$k = stripcslashes($k);
$v = "";
if (isset(App::$strings[$k])) {
$v = App::$strings[$k];
} else {
$k = "__ctx:".$c."__ ".$k;
if (isset(App::$strings[$k])) {
$v = App::$strings[$k];
$c = "";
};
}
if (!empty($v)) {
if (is_array($v)) {
$l = "";
$n = 0;
foreach ($v as &$value) {
$l .= "msgstr[".$n."] \"".addcslashes($value,"\"\n")."\"\n";
$n++;
}
} else {
$l = "msgstr \"".addcslashes($v,"\"\n")."\"\n";
}
}
}
if (substr($l,0,6)=="msgid_" || substr($l,0,7)=="msgstr[") $ink = False;
if ($ink) {
preg_match('/^"(.*)"$/',$l,$m);
$k .= $m[1];
}
if (substr($l,0,6)=="msgid ") {
preg_match('/^msgid "(.*)"$/',$l,$m);
$k = $m[1];
$ink = True;
}
if (substr($l,0,8)=="msgctxt ") {
preg_match('/^msgctxt "(.*)"$/',$l,$m);
$c = $m[1];
}
$out .= $l;
}
}
file_put_contents($pofile, $out);
?>
+3 -2
View File
@@ -58,8 +58,9 @@ function po2php_run($argc,$argv) {
$out .= 'function string_plural_select_' . $lang . '($n){'."\n";
$out .= ' return '.$cond.';'."\n";
$out .= '}}'."\n";
$out .= 'App::$rtl = ' . intval($rtl) ;
$out .= 'App::$rtl = ' . intval($rtl) . ";\n" ;
$out .= 'App::$strings["plural_function_code"] = "' . str_replace("$", "", $cond) . '"';
}
if ($k!="" && substr($l,0,7)=="msgstr "){
+9 -7
View File
@@ -12,25 +12,27 @@
App::init();
$cmd = ((x(App::$config,'system')) && (x(App::$config['system'],'php_path')) && (strlen(App::$config['system']['php_path'])) ? App::$config['system']['php_path'] : 'php') . ' -l ';
echo "Directory: include\n";
$files = glob('include/*.php');
foreach($files as $file) {
echo $file . "\n";
echo exec($cmd . $file) . "\n";
include_once($file);
}
echo "Directory: include/dba\n";
$files = glob('include/dba/*.php');
foreach($files as $file) {
echo $file . "\n";
echo exec($cmd . $file) . "\n";
include_once($file);
}
echo "Directory: include/photo\n";
$files = glob('include/photo/*.php');
foreach($files as $file) {
echo $file . "\n";
echo exec($cmd . $file) . "\n";
include_once($file);
}
@@ -39,7 +41,7 @@
$files = glob('Zotlabs/*/*.php');
foreach($files as $file) {
if((strpos($file,'SiteModule') === false) || (strpos($file,'SiteWidget') === false)) {
echo $file . "\n";
echo exec($cmd . $file) . "\n";
include_once($file);
}
}
@@ -47,7 +49,7 @@
echo "Directory: Zotlabs/Module (sub-modules)\n";
$files = glob('Zotlabs/Module/*/*.php');
foreach($files as $file) {
echo $file . "\n";
echo exec($cmd . $file) . "\n";
include_once($file);
}
@@ -58,7 +60,7 @@
$addon = basename($dir);
$files = glob($dir . '/' . $addon . '.php');
foreach($files as $file) {
echo $file . "\n";
echo exec($cmd . $file) . "\n";
include_once($file);
}
}
@@ -77,6 +79,6 @@
$files = glob('view/*/hstrings.php');
foreach($files as $file) {
echo $file . "\n";
echo exec($cmd . $file) . "\n";
passthru($phpath . ' util/typohelper.php ' . $file);
}
+7
View File
@@ -44,3 +44,10 @@ for a in "${filelist[@]}" ; do
echo linking $base
ln -s ../extend/addon/$1/$base $base
done
for x in `ls` ; do
if [ -L "$x" ] && ! [ -e "$x" ]; then
echo "removing dead symlink $x" ;
rm -- "$x";
fi;
done