diff options
author | Filip Komar <filip@mageia.org> | 2014-03-16 13:55:38 +0000 |
---|---|---|
committer | Filip Komar <filip@mageia.org> | 2014-03-16 13:55:38 +0000 |
commit | de07ef83d4ceb206a30d7bf6dbab6323bc0b02b1 (patch) | |
tree | 2b5e538176b9d27d9a008957b92a631956cd1480 /langs/report.php | |
parent | cf636c606e93ed522ef2da9f8e41bc4c2f70fd1c (diff) | |
download | www-de07ef83d4ceb206a30d7bf6dbab6323bc0b02b1.tar www-de07ef83d4ceb206a30d7bf6dbab6323bc0b02b1.tar.gz www-de07ef83d4ceb206a30d7bf6dbab6323bc0b02b1.tar.bz2 www-de07ef83d4ceb206a30d7bf6dbab6323bc0b02b1.tar.xz www-de07ef83d4ceb206a30d7bf6dbab6323bc0b02b1.zip |
fixed proper handling of fuzzy strings in reports
Diffstat (limited to 'langs/report.php')
-rw-r--r-- | langs/report.php | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/langs/report.php b/langs/report.php index 5725137d3..e0db9d987 100644 --- a/langs/report.php +++ b/langs/report.php @@ -51,6 +51,7 @@ $enFiles = array_merge(array('../_nav/langs/en.lang'), get_lang_references('*.lang'), get_lang_references('*.pot')); // added navigation file sort($enFiles); } + $num_of_enFiles = count($enFiles); if (isset($one_language) && $one_language != 'all') { $otherLangs = array('en', $one_language); @@ -131,11 +132,16 @@ if ($gettext) { $test = _po_diff($l, $resource); + $num_of_missing_strings = 0; + $num_of_fuzzy_or_missing_strings = count($test['fuzzy_or_missing']); } else { $test = _lang_diff($f, $langF); + $num_of_missing_strings = count($test['missing']); + $num_of_fuzzy_or_missing_strings = 0; } $num_of_untranslated_strings = count($test['notrans']); $num_of_duplicated_strings = count($test['dup_str']); + $num_of_extra_strings = count($test['extra']); if ($link == 'about/constitution') { $constitution_results = aproximate_number_of_untranslated_constitution_lines(G_APP_ROOT, $l, $unique_lines_in_eng_constitution); @@ -201,12 +207,13 @@ } $link .= $page_not_linked . '</div>'; - if (count($test['missing']) === 0 + if ($num_of_missing_strings === 0 + && $num_of_fuzzy_or_missing_strings === 0 && $num_of_untranslated_strings === 0) { $extra = null; - if (count($test['extra']) > 0) { - $extra = ' <span class="small">' . sprintf($diff_link, $f, $l) . '+' . count($test['extra']) . '</a></span>'; + if ($num_of_extra_strings > 0) { + $extra = ' <span class="small">' . sprintf($diff_link, $f, $l) . '+' . $num_of_extra_strings . '</a></span>'; } if ($num_of_duplicated_strings > 0) { $extra .= ' <span class="small">' . sprintf($diff_link, $f, $l) . 'dup: ' . $num_of_duplicated_strings . '</a></span>'; @@ -229,14 +236,17 @@ $cols .= sprintf('<td class="strings">' . $diff_link, $f, $l); - if (count($test['missing']) > 0) { - $cols .= count($test['missing']) . ' missing<br>'; + if ($num_of_missing_strings > 0) { + $cols .= $num_of_missing_strings . ' missing<br>'; + } + if ($num_of_fuzzy_or_missing_strings > 0) { + $cols .= $num_of_fuzzy_or_missing_strings . ' fuzzy or missing<br>'; } if ($num_of_untranslated_strings > 0) { $cols .= $num_of_untranslated_strings . ' untranslated<br>'; } - if (count($test['extra']) > 0) { - $cols .= count($test['extra']) . ' extra<br>'; + if ($num_of_extra_strings > 0) { + $cols .= $num_of_extra_strings . ' extra<br>'; } if ($num_of_duplicated_strings > 0) { $cols .= $num_of_duplicated_strings . ' duplicate'; @@ -244,7 +254,7 @@ } $cols .= '</a>'; $cols .= $link . '</td>'; - $done = $test['a'] - $num_of_untranslated_strings - count($test['missing']); + $done = $test['a'] - $num_of_untranslated_strings - $num_of_missing_strings - $num_of_fuzzy_or_missing_strings; } } $stats[$l]['strings'] += $done; @@ -256,7 +266,7 @@ } $num_clmns_to_repeat = 9; $num_of_col++; - if ($num_of_col % $num_clmns_to_repeat == 0 && $num_of_col <= count($enFiles) - ($num_clmns_to_repeat / 3)) { + if ($num_of_col % $num_clmns_to_repeat == 0 && $num_of_col <= $num_of_enFiles - ($num_clmns_to_repeat / 3)) { if ($l == 'en') { $cols .= $lang_coloumn = '<td style="font-weight: bold;">Language</td>'; } else { @@ -291,7 +301,7 @@ $lang_line = array(); $num_of_h_col = 0; $add_last_coloumn = FALSE; - $resources = ($restore_resources ? ' ' : count($enFiles) . ' resources'); + $resources = ($restore_resources ? ' ' : $num_of_enFiles . ' resources'); foreach ($enFiles as $lang_chunk) { $num_of_h_col++; if ($restore_resources) { @@ -299,7 +309,7 @@ } else { $lang_line[] = '<a href="?r=' . $lang_chunk . '" title="see only this resource">' . str_replace('en/', '', $lang_chunk) . '</a>'; } - if ($num_of_h_col % $num_clmns_to_repeat == 0 && $num_of_h_col <= count($enFiles) - ($num_clmns_to_repeat / 3)) { + if ($num_of_h_col % $num_clmns_to_repeat == 0 && $num_of_h_col <= $num_of_enFiles - ($num_clmns_to_repeat / 3)) { $lang_line[] = $resources; $add_last_coloumn = TRUE; } |