mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-17 02:43:26 +00:00
check if the po/ folder does really exist...
(if it does not exist, the rest does not have to be done either)
This commit is contained in:
parent
01274b8d41
commit
f5034ccfa3
@ -50,26 +50,29 @@ function grab_stats ($tob, $official, $packs) // trunk or branch, official (1) o
|
||||
$po_dir = $basedir . "/" . $package . "/po/";
|
||||
$domain = getdomain($package);
|
||||
}
|
||||
$languages = file_get_contents($po_dir . "/LINGUAS");
|
||||
$languages = substr($languages, 0, strlen($languages)-1);
|
||||
$langs = explode(" ", $languages);
|
||||
echo "<h2>Getting stats for package $package</h2>";
|
||||
$stats["_pot"] = getstats("$po_dir/" . $domain . ".pot");
|
||||
if (!file_exists("stats/" . $domain))
|
||||
if (file_exists($po_dir)) // it can happen that the translation is broken in wescamp, this only happens when there is no po/ folder
|
||||
{
|
||||
system("mkdir stats/" . $domain);
|
||||
$languages = file_get_contents($po_dir . "/LINGUAS");
|
||||
$languages = substr($languages, 0, strlen($languages)-1);
|
||||
$langs = explode(" ", $languages);
|
||||
echo "<h2>Getting stats for package $package</h2>";
|
||||
$stats["_pot"] = getstats("$po_dir/" . $domain . ".pot");
|
||||
if (!file_exists("stats/" . $domain))
|
||||
{
|
||||
system("mkdir stats/" . $domain);
|
||||
}
|
||||
foreach ($langs as $lang)
|
||||
{
|
||||
echo "Getting stats for lang $lang<br/>";
|
||||
$pofile = $po_dir . "/" . $lang . ".po";
|
||||
$stats[$lang] = getstats($pofile);
|
||||
}
|
||||
|
||||
$serialized = serialize($stats);
|
||||
$file = fopen("stats/" . $domain . "/" . $tob . "stats", "wb");
|
||||
fwrite($file, $serialized);
|
||||
fclose($file);
|
||||
}
|
||||
foreach ($langs as $lang)
|
||||
{
|
||||
echo "Getting stats for lang $lang<br/>";
|
||||
$pofile = $po_dir . "/" . $lang . ".po";
|
||||
$stats[$lang] = getstats($pofile);
|
||||
}
|
||||
|
||||
$serialized = serialize($stats);
|
||||
$file = fopen("stats/" . $domain . "/" . $tob . "stats", "wb");
|
||||
fwrite($file, $serialized);
|
||||
fclose($file);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user