0, 'size' => 0 ];
+ global $TRANSLATION_STATUSES_OFF_TOTAL;
+
while ($row = $result->fetchArray(SQLITE3_ASSOC)) {
$stats[$row['status']] = $row;
- if ($row['status'] != 'NotInEnTree') {
+ if ($row['status'] != 'NotInEnTree'
+ && !in_array($row['status'], $TRANSLATION_STATUSES_OFF_TOTAL)) {
$total['total'] += $row['total'];
$total['size'] += $row['size'];
}
diff --git a/www/revcheck.php b/www/revcheck.php
index 28e2bc0..7d30004 100644
--- a/www/revcheck.php
+++ b/www/revcheck.php
@@ -180,6 +180,63 @@
echo gen_date($DBLANG);
break;
+ case 'brokenfiles':
+ $brokenfiles = get_brokenfiles($dbhandle, $lang);
+
+ if (!$brokenfiles) {
+ echo 'Good, all translated files are valid XML.
';
+ } else {
+ $num = count($brokenfiles);
+ echo 'These files do not parse as XML. The manual build may fail, or silently ';
+ echo 'drop their contents, so they need a fix before anything else.
';
+ echo '';
+ echo '| Broken XML files ('.$num.' files): | Error | kB |
';
+
+ $last_dir = false;
+ foreach ($brokenfiles as $row) {
+ if (!$last_dir || $last_dir != $row['dir']) {
+ echo '| '.htmlspecialchars($row['dir']).' |
';
+ $last_dir = $row['dir'];
+ }
+ echo '',
+ '| ', htmlspecialchars($row['name']), ' | ',
+ '', htmlspecialchars($row['error']), ' | ',
+ '', $row['size'], ' | ',
+ '
';
+ }
+ echo '
';
+ }
+ echo gen_date($DBLANG);
+ break;
+
+ case 'donottranslate':
+ $donottranslate = get_donottranslate($dbhandle, $lang);
+
+ if (!$donottranslate) {
+ echo 'No source file is marked do not translate.
';
+ } else {
+ $num = count($donottranslate);
+ echo 'These English files carry a <?do-not-translate?> mark. They are ';
+ echo 'not expected to be translated, and are left out of the totals of this translation.
';
+ echo '';
+ echo '| Marked do not translate ('.$num.' files): | kB |
';
+
+ $last_dir = false;
+ foreach ($donottranslate as $row) {
+ if (!$last_dir || $last_dir != $row['dir']) {
+ echo '| '.htmlspecialchars($row['dir']).' |
';
+ $last_dir = $row['dir'];
+ }
+ echo '',
+ '| ', htmlspecialchars($row['name']), ' | ',
+ '', $row['size'], ' | ',
+ '
';
+ }
+ echo '
';
+ }
+ echo gen_date($DBLANG);
+ break;
+
case 'misstags':
$misstags = get_misstags($dbhandle, $lang);
@@ -211,16 +268,21 @@
echo '| File status type | Number of files | Percent of files | Size of files (kB) | Percent of size |
';
foreach ($TRANSLATION_STATUSES as $status => $description) {
+ // A status kept out of the total has no meaningful share of it.
+ $offTotal = in_array($status, $TRANSLATION_STATUSES_OFF_TOTAL);
+
echo
'',
'| ', $description, ' | ',
'', $stats[$status]['total'] ?? 0, ' | ',
'',
- sprintf('%.2f%%', 100 * (($stats[$status]['total'] ?? 0) / $stats['total']['total'])),
+ $offTotal ? 'n/a'
+ : sprintf('%.2f%%', 100 * (($stats[$status]['total'] ?? 0) / $stats['total']['total'])),
' | ',
'', $stats[$status]['size'] ?? 0, ' | ',
'',
- sprintf('%.2f%%', 100 * (($stats[$status]['size'] ?? 0) / $stats['total']['size'])),
+ $offTotal ? 'n/a'
+ : sprintf('%.2f%%', 100 * (($stats[$status]['size'] ?? 0) / $stats['total']['size'])),
' | ',
'
';
}