aboutsummaryrefslogtreecommitdiffstats
path: root/langs
diff options
context:
space:
mode:
authorfilip <filip.komar@gmail.com>2014-12-01 18:27:06 +0100
committerfilip <filip.komar@gmail.com>2014-12-01 18:27:06 +0100
commitba52d75eca07cbfaec5f3de05a9d2746c014dbb4 (patch)
treea568e35794c966c26a469fd7ee64bebe010fa224 /langs
parent9639dfb548d0804d9ea637f902fa453790264ac4 (diff)
downloadwww-ba52d75eca07cbfaec5f3de05a9d2746c014dbb4.tar
www-ba52d75eca07cbfaec5f3de05a9d2746c014dbb4.tar.gz
www-ba52d75eca07cbfaec5f3de05a9d2746c014dbb4.tar.bz2
www-ba52d75eca07cbfaec5f3de05a9d2746c014dbb4.tar.xz
www-ba52d75eca07cbfaec5f3de05a9d2746c014dbb4.zip
added some verbosity
Diffstat (limited to 'langs')
-rw-r--r--langs/report_tx_git.php22
1 files changed, 6 insertions, 16 deletions
diff --git a/langs/report_tx_git.php b/langs/report_tx_git.php
index 829f72f16..8d420153e 100644
--- a/langs/report_tx_git.php
+++ b/langs/report_tx_git.php
@@ -56,23 +56,8 @@ function tx_call($tx_request, $project = 'project/mageia/')
$user = "filip_mageia";
$pass = "report";
-/*
- // create a new cURL resource
- $curl_handle = curl_init();
- // TX username and password
- curl_setopt($curl_handle, CURLOPT_USERPWD, "$user:$pass");
-
- // return, do not echo
- curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, TRUE);
-
- // pass url
- curl_setopt($curl_handle, CURLOPT_URL, "http://$tx_url");
-
- $tx_result = curl_exec($curl_handle);
- curl_close($curl_handle);
-/**/
- $tx_result = file_get_contents("http://$user:$pass@$tx_url");
+ $tx_result = @file_get_contents("http://$user:$pass@$tx_url");
$tx_result_array = json_decode($tx_result, TRUE);
$json_last_error = json_last_error();
@@ -112,8 +97,10 @@ function build_links($git_resource_name, $language_code, $resource_type, $stat_d
$links_and_num = "<a href=\"http://www.transifex.com/organization/MageiaLinux/dashboard/all_resources/";
$links_and_num .= "$language_code/#1/?s=$tx_resource_name&amp;c=$resource_type\">Tx</a>: ";
$links_and_num .= $stat_data['tx_untran'];
+ $links_and_num .= (0 == $stat_data['tx_untran'] ? ' - full' : '');
$links_and_num .= ', <a href="http://gitweb.mageia.org/web/' . $git_link . '">git</a>: ';
$links_and_num .= $stat_data['git_untran'];
+ $links_and_num .= ($stat_data['num_of_all'] == $stat_data['git_untran'] ? ' - empty' : '');
return $links_and_num;
}
@@ -336,6 +323,7 @@ if (0 < $num_of_resources_w_difference && $num_for_switch_table_to_list > $num_o
}
if (array_key_exists($resource_with_tx_git_diff, $one_language_array)) {
$stat_data = array();
+ $stat_data['num_of_all'] = $one_language_array[$resource_with_tx_git_diff]['tx_num_of_all_strings'];
$stat_data['tx_untran'] = $one_language_array[$resource_with_tx_git_diff]['tx_untranslated'];
$stat_data['git_untran'] = $one_language_array[$resource_with_tx_git_diff]['git_untranslated'];
@@ -373,6 +361,7 @@ if (0 < $num_of_resources_w_difference) {
$miss_first = TRUE;
foreach ($one_language_resources as $one_language_resource) {
$stat_data = array();
+ $stat_data['num_of_all'] = $one_language_array[$one_language_resource]['tx_num_of_all_strings'];
$stat_data['tx_untran'] = $one_language_array[$one_language_resource]['tx_untranslated'];
$stat_data['git_untran'] = $one_language_array[$one_language_resource]['git_untranslated'];
@@ -395,6 +384,7 @@ if (0 < $num_of_resources_w_difference) {
foreach ($tx_git_difference as $one_language => $one_language_array) {
if (isset($one_language_array[$resource_with_tx_git_diff])) {
$stat_data = array();
+ $stat_data['num_of_all'] = $one_language_array[$resource_with_tx_git_diff]['tx_num_of_all_strings'];
$stat_data['tx_untran'] = $one_language_array[$resource_with_tx_git_diff]['tx_untranslated'];
$stat_data['git_untran'] = $one_language_array[$resource_with_tx_git_diff]['git_untranslated'];