diff options
author | filip <filip.komar@gmail.com> | 2014-12-02 19:26:35 +0100 |
---|---|---|
committer | filip <filip.komar@gmail.com> | 2014-12-02 19:26:35 +0100 |
commit | c9f8e04fc0f461f8cb3cc875b95e5d055267065c (patch) | |
tree | bab4c7ef59ca2e9537d2f8e75a05404363ddeeb0 /langs/report_tx_git.php | |
parent | e1ee287a65a40c2e58a2c9f488e1b5dbe75c3830 (diff) | |
download | www-c9f8e04fc0f461f8cb3cc875b95e5d055267065c.tar www-c9f8e04fc0f461f8cb3cc875b95e5d055267065c.tar.gz www-c9f8e04fc0f461f8cb3cc875b95e5d055267065c.tar.bz2 www-c9f8e04fc0f461f8cb3cc875b95e5d055267065c.tar.xz www-c9f8e04fc0f461f8cb3cc875b95e5d055267065c.zip |
adding a list of resources over treshold for language not in a git
Diffstat (limited to 'langs/report_tx_git.php')
-rw-r--r-- | langs/report_tx_git.php | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/langs/report_tx_git.php b/langs/report_tx_git.php index 8d420153e..edc18ccb9 100644 --- a/langs/report_tx_git.php +++ b/langs/report_tx_git.php @@ -184,9 +184,7 @@ foreach ($tx_resources_info as $tx_resource_info) { $tx_all_languages[] = $tx_resource_language; } if ($tx_lang_completed_treshold <= $completed) { - if (!in_array($tx_resource_language, $tx_all_langs_above_treshold)) { - $tx_all_langs_above_treshold[] = $tx_resource_language; - } + $tx_all_langs_above_treshold[$tx_resource_language][] = $tx_resource_name; } foreach ($report as $git_resource_info) { $git_resource_name = $git_resource_info['resource_name']; @@ -235,26 +233,31 @@ sort($tx_all_resource_names, SORT_STRING); sort($git_all_resource_names, SORT_STRING); sort($git_compare_resources, SORT_STRING); sort($tx_all_languages); -sort($tx_all_langs_above_treshold); +ksort($tx_all_langs_above_treshold); // sort by lang sort($git_all_languages); sort($nonequal_num_of_all_strings, SORT_STRING); $tx_only_resources = array_diff($tx_all_resource_names, $git_compare_resources); $git_only_resources = array_diff($git_compare_resources, $tx_all_resource_names); -$tx_only_languages = array_diff($tx_all_langs_above_treshold, $git_all_languages); +$tx_only_languages = array_diff(array_keys($tx_all_langs_above_treshold), $git_all_languages); $git_only_languages = array_diff($git_all_languages, $tx_all_languages); // preparing text for languages not present yet in our git repositories $tx_only_languages_details = ''; if (0 < count($tx_only_languages)) { $tx_only_languages_details = "<h3>Languages with at least one resource for $resource_type translated over treshold "; - $tx_only_languages_details .= "($tx_lang_completed_treshold %) but not present yet in our git:</h3>"; - $tx_only_languages_details .= '<p>Please add them to our git.</p><ul>'; + $tx_only_languages_details .= "($tx_lang_completed_treshold %) but not present yet in our git:</h3><ul>"; foreach ($tx_only_languages as $tx_only_language) { $tx_language_details = tx_call("language/$tx_only_language", ''); $tx_only_languages_details .= '<li><span class="bold">' . $tx_only_language . '</span>: '; $tx_only_languages_details .= '<a href="http://www.transifex.com/organization/MageiaLinux/dashboard/all_resources/'; - $tx_only_languages_details .= "$tx_only_language/#1/?c=$resource_type\">" . $tx_language_details['name'] . "</a>,</li>"; + $tx_only_languages_details .= "$tx_only_language/#1/?c=$resource_type\">" . $tx_language_details['name'] . "</a> (resources over treshold: "; + $resources_above_treshold = array(); + foreach ($tx_all_langs_above_treshold[$tx_only_language] as $resource_above_treshold) { + $resources_above_treshold[] = $resource_above_treshold; + } + sort($resources_above_treshold); + $tx_only_languages_details .= implode(", ", $resources_above_treshold) . "),</li>"; } $tx_only_languages_details .= '</ul>'; } |