www.mageia.org translation report

Report about differences between Transifex and our git repository is available here.

Language $one_language is not present in our web site yet.

"; } } $enFiles = array_merge(array('../_nav/langs/en.pot'), get_lang_references('*.pot')); // added navigation file if (!empty($one_resource) && $one_resource != 'all') { if (in_array($one_resource, $enFiles)) { $all_languages_only_one_resource = TRUE; $enFiles = array($one_resource); } else { echo "

Resource $one_resource is not present in our web site yet.

"; } } $num_of_enFiles = count($enFiles); $report = array(); $ok_link = '
%s file
'; $diff_link = '
%s'; $add_trans = ''; $unique_lines_in_eng_constitution = array(); $number_of_unique_lines_in_eng_constitution = 0; foreach ($otherLangs as $l) { foreach ($enFiles as $f) { $references = ''; $page_not_linked = ''; $old_page = ''; $resource = _extract_resource($f); $resource_filename = str_replace('index', '', $resource); $mga = array('view page' => $resource_filename); $langF = _po_file_switch($f, $l); if (strstr($f, '../_nav/langs/en.') !== FALSE) { $nav = TRUE; $dest_en = sprintf('%s/%s/%s', G_APP_ROOT, '_nav/langs', 'en.pot'); $dest_l = sprintf('%s/%s/%s', G_APP_ROOT, '_nav/langs', $l . '.po'); $langF = '../_nav/langs/' . $l . '.po' . (($l == 'en') ? 't' : ''); } else { $nav = FALSE; $dest_en = sprintf('%s/%s/%s/%s', G_APP_ROOT, 'en', $resource_filename, 'index.php'); $dest_l = sprintf('%s/%s/%s/%s', G_APP_ROOT, $l, $resource_filename, 'index.php'); } // if symlink e.g. does directly translated page exist? if ((realpath($dest_l) != realpath($dest_en)) && !$nav) { $page_not_linked = sprintf('old page still exists!', $l, $resource_filename); $old_page = sprintf(' by recycling old page', $l, $resource_filename); } $add_new_translation = sprintf($add_trans, $f, $l, $old_page); if (file_exists($langF)) { $test = _po_diff($l, $resource); $num_of_fuzzy_or_missing_strings = count($test['fuzzy_or_missing']); $num_of_untranslated_strings = count($test['notrans']); if ($nav) { $mga = array('see navigation' => ''); } else if ($resource_filename == 'downloads/get') { $mga = array( 'view page A' => 'downloads/get/index.php?q=Mageia-5-LiveCD-KDE4-en-i586-CD.iso&d=1', 'B' => 'downloads/get/index.php?q=Non_existing_file&d=1', ); } else if ($resource_filename == '2') { $mga = array( 'view page A' => '2/index.php', 'B' => '2/download_index.php', 'C' => '2/for-pc/index.php', 'D' => '2/for-server/index.php', ); } else if ($resource_filename == '3') { $mga = array( 'view page A' => '3/index.php', 'B' => '3/download_index.php', 'C' => '3/for-pc/index.php', 'D' => '3/for-server/index.php', ); } else if ($resource_filename == '4') { $mga = array( 'view page A' => '4/index.php', 'B' => '4/download_index.php', ); } else if ($resource_filename == '5') { $mga = array( 'view page A' => '5/index.php', 'B' => '5/download_index.php', ); } else if ($resource_filename == 'cauldron') { $mga = array('view page' => 'downloads/prerelease/index.php'); } else if ($resource_filename == 'documentation') { $mga = array( 'view page doc' => 'doc/index.php', 'archive' => 'doc/archive.php', ); } else if ($resource_filename == 'news') { $mga = array( 'view page A' => '', 'B' => 'community/', ); } else if ($resource_filename == 'common_footer') { $mga = array('view footer of page' => ''); } else if ($resource_filename == 'about/constitution') { $constitution_results = aproximate_number_of_untranslated_constitution_lines(G_APP_ROOT, $l, $unique_lines_in_eng_constitution); if ($l == 'en') { $unique_lines_in_eng_constitution = $constitution_results['unique_lines_in_constitution']; $number_of_unique_lines_in_eng_constitution = count($unique_lines_in_eng_constitution); } $test['a'] += $number_of_unique_lines_in_eng_constitution; // add aproximate number of lines from constitution to translate $num_of_untranslated_strings += $constitution_results['aproximate_number_of_untranslated_lines']; } else if ($resource_filename == 'about/license') { require_once('../en/about/license/license.php'); $license_numbers = load_license_numbers($l, TRUE); if ($l == 'en') { $number_of_unique_lines_in_eng_license = $license_numbers["all"]; } $test['a'] += $license_numbers["all"]; // add aproximate number of untranslated sentences from license $num_of_untranslated_strings += $license_numbers["untran"]; // add number of all license sentences } $link = ''; foreach ($mga as $k => $v) { $link .= sprintf('%s', $l, $v, $k); } $link .= $page_not_linked; // . '
'; if ($num_of_fuzzy_or_missing_strings === 0 && $num_of_untranslated_strings === 0) { $references .= sprintf($ok_link, $link, $langF); } else { if(($num_of_fuzzy_or_missing_strings + $num_of_untranslated_strings) < $test['a']) { $references .= sprintf($diff_link, $link, $f, $l); $fuzzy = FALSE; if ($num_of_fuzzy_or_missing_strings > 0) { $references .= $num_of_fuzzy_or_missing_strings . ' fuzzy or missing'; $fuzzy = TRUE; } if ($num_of_untranslated_strings > 0) { $references .= ($fuzzy ? ', ' : '') . $num_of_untranslated_strings . ' untranslated'; } $references .= '
'; } else { $references .= $add_new_translation; } } } else { // file $langF doesn't exists $references .= $add_new_translation; $test = _po_diff('en', $resource); $num_of_fuzzy_or_missing_strings = 0; $num_of_untranslated_strings = count($test['notrans']); if ($resource_filename == 'about/constitution') { // add aproximate number of all lines from constitution $test['a'] += $number_of_unique_lines_in_eng_constitution; $num_of_untranslated_strings += $number_of_unique_lines_in_eng_constitution; } if ($resource_filename == 'about/license') { // add number of all license sentences $test['a'] += $number_of_unique_lines_in_eng_license; $num_of_untranslated_strings += $number_of_unique_lines_in_eng_license; } } $report[] = array( 'language' => $l, 'resource_filename' => $f, 'num_of_all_strings' => $test['a'], 'num_of_fuzzy_or_missing_strings' => $num_of_fuzzy_or_missing_strings, 'num_of_untranslated_strings' => $num_of_untranslated_strings, 'references' => $references, ); } } $summary = build_language_and_resource_summary($report, $all_languages_only_one_resource, $one_resource, $one_language_all_resources, $one_language); $total_num_of_strings = $summary['total_num_of_strings']; // total of all source strings $language_summary = $summary['language_summary']; $resource_summary = $summary['resource_summary']; if ($one_language_all_resources) { $report_text = '

Restore all languages.

'; $count = 'One language: ' . $langs[$one_language]; $summary_text = 'Summary for each of ' . $num_of_enFiles . ' resources'; $display_array = $resource_summary; $progress = 'ReferencesProgress'; $stats_width = '70px'; } else if ($all_languages_only_one_resource) { $report_text = '

Restore all resources.

'; $count = 'Together ' . count($otherLangs) . ' languages'; $summary_text = 'Summary for resource: ' . $one_resource; $eng_language = array_shift($language_summary); // shift English for proper sorting $display_array = $language_summary; $stats_width = '70px'; $progress = 'ReferencesProgress'; } else { // all languages, all resources $report_text = ''; //

Overview of all languages.

$count = 'Together ' . count($otherLangs) . ' languages'; $summary_text = 'Summary for all ' . $num_of_enFiles . ' resources'; $eng_language = array_shift($language_summary); // shift English for proper sorting $display_array = $language_summary; $sum_for_stat = $total_num_of_strings; $stats_width = '85px'; $references = ''; $progress = 'Progress'; } // build helper arrays foreach ($display_array as $key => $row) { if ($one_language_all_resources) { $first_helper[$key] = $row['num_of_translated_strings'] / $row['num_of_all_strings']; $second_helper[$key] = $row['num_of_fuzzy_or_missing_strings'] / $row['num_of_all_strings']; $third_helper[$key] = $row['resource_filename']; } else if ($all_languages_only_one_resource) { $first_helper[$key] = $row['num_of_translated_strings'] / $row['num_of_all_strings']; $second_helper[$key] = $row['num_of_fuzzy_or_missing_strings'] / $row['num_of_all_strings']; $third_helper[$key] = $row['language']; } else { // all languages, all resources $first_helper[$key] = $row['num_of_translated_strings'] / $total_num_of_strings; $second_helper[$key] = $row['num_of_fuzzy_or_missing_strings'] / $total_num_of_strings; $third_helper[$key] = $row['language']; } } array_multisort($first_helper, SORT_DESC, $second_helper, $third_helper, $display_array); // , SORT_STRING // array_unshift($language_summary, $eng_language); // unshift English back $table_lines = array(); $progress_width = 350; foreach ($display_array as $one_member) { $translation_status = 'translated: ' . $one_member['num_of_translated_strings']; $translation_status .= ', fuzzy or missing: ' . $one_member['num_of_fuzzy_or_missing_strings']; $translation_status .= ', untranslated: ' . $one_member['num_of_untranslated_strings']; if ($one_language_all_resources) { $first_clmn = $one_member['resource_filename']; $link_one = ''; if ($first_clmn == '../_nav/langs/en.pot') { $frst_clmn_t = '_nav/langs/en.pot'; } else { $frst_clmn_t = str_replace('en/', '', $first_clmn); } $first_clm_text = sprintf('' . $link_one . '%s', 'see this resource only', $frst_clmn_t); $single_stat = $one_member['num_of_translated_strings']; $sum_for_stat = $one_member['num_of_all_strings']; $references = '' . $one_member['references'] . ''; } else if ($all_languages_only_one_resource) { $first_clmn = $one_member['language']; $link_one = ''; $first_clm_text = sprintf('' . $link_one . '%s, ', 'see this language only', $langs[$first_clmn]); $single_stat = $one_member['num_of_translated_strings']; $sum_for_stat = $one_member['num_of_all_strings']; $references = '' . $one_member['references'] . ''; } else { // all languages, all resources $first_clmn = $one_member['language']; $link_one = ''; $first_clm_text = sprintf('' . $link_one . '%s, ', 'see this language only', $langs[$first_clmn]); $first_clm_text .= sprintf('%s', $first_clmn); $single_stat = $one_member['num_of_translated_strings']; } $progress_tran_float = $one_member['num_of_translated_strings'] / $sum_for_stat; $progress_trans = floor($progress_tran_float * 100); $progress_tran_round = floor($progress_tran_float * $progress_width); $progress_fom_float = $one_member['num_of_fuzzy_or_missing_strings'] / $sum_for_stat; $progress_fom_round = round($progress_fom_float * $progress_width); $progress_untrans = $progress_width - $progress_tran_round - $progress_fom_round; $row = '' . $first_clm_text . ''; $row .= $references; $row .= '
' . $progress_trans . ' %
'; $row .= '
(' . $single_stat . ' / ' . $sum_for_stat . ')
'; $row .= sprintf('' . $link_one, $translation_status); $row .= '
 
' . PHP_EOL; $row .= '
 
' . PHP_EOL; $row .= '
 
' . PHP_EOL; $row .= '' . PHP_EOL; $table_lines[] = $row; } $table_rows = implode('', $table_lines); echo $report_text; echo << {$count} {$progress} {$summary_text} {$table_rows}
S; ?>

Source code for this website is available on git.