';
$languages = array();
foreach ($otherLangs as $l) {
if (is_dir($f)) continue;
$stats['en']['files'] += 1;
$s = sprintf('
%s (%s) | ',
$langs[$l], $l);
$cols = '';
foreach ($enFiles as $f) {
$langF = str_replace('.en.lang', '.' . $l . '.lang', $f);
$langF = $l . substr($langF, 2);
if (file_exists($langF)) {
$stats[$l]['files'] += 1;
$link = str_replace(array('en/', '.en.lang', 'index'), '', $f);
$link = sprintf('check page', $l, $link);
$test = _lang_diff($f, $langF);
if (count($test['missing']) === 0
&& count($test['notrans']) === 0) {
$extra = null;
if (count($test['extra']) > 0) {
$extra = ' ' . sprintf($diff_link, $f, $l) . '(+' . count($test['extra']) . ')';
}
$cols .= sprintf('OK%s%s | ',
$langF, $extra, $link);
$done = $test['a'];
}
else {
// special case, en
if ($l == 'en') {
$cols .= '' . count($test['notrans']) . ' strings | ';
$enStringsCount[$f] += $test['a'];
$done = $test['a'];
// regular case
} else {
$cols .= sprintf('' . $diff_link,
$f, $l);
if (count($test['missing']) > 0) {
$cols .= count($test['missing']) . ' missing ';
}
if (count($test['notrans']) > 0) {
$cols .= count($test['notrans']) . ' untranslated ';
}
if (count($test['extra']) > 0) {
$cols .= count($test['extra']) . ' extra';
}
$cols .= '';
$cols .= $link . ' | ';
$done = $test['a'] - count($test['notrans']) - count($test['missing']);
}
}
$stats[$l]['strings'] += $done;
} else {
$stats[$l]['files'] += 0;
$stats[$l]['strings'] += 0;
$cols .= sprintf('add | ',
$f, $l
);
}
}
$progress = floor($stats[$l]['strings'] / $stats['en']['strings'] * 100);
$s .= sprintf(
'%d%% %d / %d | ',
$progress,
$stats[$l]['strings'],
$stats['en']['strings']
);
$s .= $cols;
$s .= '
---|
';
$languages[$progress . '-' . $l] = $s;
}
$en_language = array_shift($languages); // shift English for proper sorting
krsort($languages, SORT_NUMERIC);
array_unshift($languages, $en_language); // unshift English back
$s = implode($languages);
$thfiles = '
' . implode(' | ', $enFiles) . ' | ';
$count = count($otherLangs);
echo <<
{$count} languages |
Completeness |
{$thfiles}
{$s}
S;
?>