From 78d942fea3a8b93e2f5e740037492d4ae0a8e6c5 Mon Sep 17 00:00:00 2001 From: filip Date: Fri, 18 Jul 2014 20:45:55 +0200 Subject: removal of obsolete lang stuff --- langs/report_test.php | 58 +++++++++------------------------------------------ 1 file changed, 10 insertions(+), 48 deletions(-) (limited to 'langs/report_test.php') diff --git a/langs/report_test.php b/langs/report_test.php index 85fed269f..b07186410 100644 --- a/langs/report_test.php +++ b/langs/report_test.php @@ -77,7 +77,7 @@ $enFiles = array($one_resource); $restore_resources = TRUE; } else { - $enFiles = array_merge(array('../_nav/langs/en.pot'), get_lang_references('*.lang'), get_lang_references('*.pot')); // added navigation file + $enFiles = array_merge(array('../_nav/langs/en.pot'), get_lang_references('*.pot')); // added navigation file sort($enFiles); } $num_of_enFiles = count($enFiles); @@ -115,15 +115,8 @@ foreach ($enFiles as $f) { - if (strrpos($f, '.pot')) { - $gettext = true; - $resource = _extract_resource($f); - $langF = _po_file_switch($f, $l); - } else { - $gettext = false; - $resource = _extract_resource($f, '.en.lang'); - $langF = _lang_file_switch($f, $l); - } + $resource = _extract_resource($f); + $langF = _po_file_switch($f, $l); $enStringsCount[$f] = 0; if (false !== strstr($f, '../_nav/langs/en.')) { $nav = true; @@ -160,20 +153,10 @@ $times[] = time_debug('file_exists'); $stats[$l]['files'] += 1; - - 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; - } + $test = _po_diff($l, $resource); + $num_of_fuzzy_or_missing_strings = count($test['fuzzy_or_missing']); $times[] = time_debug('_diff ' . $l . ' '. $f); $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); @@ -240,21 +223,10 @@ } $link .= $page_not_linked . ''; - if ($num_of_missing_strings === 0 - && $num_of_fuzzy_or_missing_strings === 0 + if ($num_of_fuzzy_or_missing_strings === 0 && $num_of_untranslated_strings === 0) { - - $extra = null; - if ($num_of_extra_strings > 0) { - $extra = ' ' . sprintf($diff_link, $f, $l) . '+' . $num_of_extra_strings . ''; - } - if ($num_of_duplicated_strings > 0) { - $extra .= ' ' . sprintf($diff_link, $f, $l) . 'dup: ' . $num_of_duplicated_strings . ''; - } - - $cols .= sprintf('OK%s%s', - $langF, $extra, $link); - + $cols .= sprintf('OK%s', + $langF, $link); $done = $test['a']; } else { // special case, en @@ -266,31 +238,21 @@ // regular case } else { - if(($num_of_missing_strings + $num_of_fuzzy_or_missing_strings + $num_of_untranslated_strings) < $test['a']) { + if(($num_of_fuzzy_or_missing_strings + $num_of_untranslated_strings) < $test['a']) { $cols .= sprintf('' . $diff_link, $f, $l); - if ($num_of_missing_strings > 0) { - $cols .= $num_of_missing_strings . ' missing
'; - } if ($num_of_fuzzy_or_missing_strings > 0) { $cols .= $num_of_fuzzy_or_missing_strings . ' fuzzy or missing
'; } if ($num_of_untranslated_strings > 0) { $cols .= $num_of_untranslated_strings . ' untranslated
'; } - if ($num_of_extra_strings > 0) { - $cols .= $num_of_extra_strings . ' extra
'; - } - if ($num_of_duplicated_strings > 0) { - $cols .= $num_of_duplicated_strings . ' duplicate'; - $cols .= ($num_of_duplicated_strings > 1 ? 's' : ''); - } $cols .= ''; $cols .= $link . ''; } else { $cols .= $add_translation; } - $done = $test['a'] - $num_of_untranslated_strings - $num_of_missing_strings - $num_of_fuzzy_or_missing_strings; + $done = $test['a'] - $num_of_untranslated_strings - $num_of_fuzzy_or_missing_strings; } } $stats[$l]['strings'] += $done; -- cgit v1.2.1