From: Jens T. <je...@us...> - 2003-08-11 22:21:33
|
Update of /cvsroot/gallery/gallery/tools In directory sc8-pr-cvs1:/tmp/cvs-serv3612 Modified Files: g1-report.php Log Message: changed order Index: g1-report.php =================================================================== RCS file: /cvsroot/gallery/gallery/tools/g1-report.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- g1-report.php 10 Aug 2003 01:47:09 -0000 1.2 +++ g1-report.php 11 Aug 2003 21:53:15 -0000 1.3 @@ -1,35 +1,16 @@ <?php include ("../Version.php"); -?> -<html> -<body> -<head> - <link rel="stylesheet" type="text/css" href="g1-report.css"> -</head> -<h2>Localization Status Report for Gallery 1</h2> -<h2>Build : <?php echo $gallery->version ?></h2> -<table align="center" border="0" cellspacing="0" cellpadding="0"> -<tr> - <th>Language</th> - <th>Locale</th> - <th>Status</th> - <th valign="bottom" style="width: 30px;">T<br/>r<br/>a<br/>n<br/>s<br/>l<br/>a<br/>t<br/>e<br/>d</th> - <th valign="bottom" style="width: 30px;">F<br/>u<br/>z<br/>z<br/>y</th> - <th valign="bottom" style="width: 30px;">U<br/>n<br/>t<br/>r<br/>a<br/>n<br/>s<br/>l<br/>a<br/>t<br/>e<br/>d</th> -</tr> -<?php -include ("../nls.php"); + include ("../nls.php"); + $nls=getNLS(); $handle=opendir('../po'); while ($file = readdir($handle)) { if (ereg("^([a-z]{2}_[A-Z]{2})(\.[a-zA-Z0-9]+)?(\-gallery.po)$", $file, $matches)) { - echo "\n<tr>"; $locale=$matches[1] . $matches[2]; if ($locale == "en_GB") continue; - echo "<td>". $nls['languages'][$locale] . "</td>"; - echo "<td>$locale</td>"; + $lines=file("../po/$file"); $fuzzy=0; $untranslated=-1; @@ -47,21 +28,56 @@ $all=$translated+$fuzzy+$untranslated; $percent_done=round($translated/$all*100,2); $rpd=round($percent_done,0); + $report[$locale]=array ($percent_done,$translated,$fuzzy,$untranslated,$bgcolor); if($rpd <50) { $color=dechex(255-$rpd*2). "0000"; } else { $color="00" . dechex(55+$rpd*2). "00"; } if (strlen($color) <6) $color="0". $color; - - echo "\n\t<td style=\"background-color:#$color\">$percent_done % done</td>"; - echo "\n\t<td class=\"translated\">$translated</td>"; - echo "\n\t<td class=\"fuzzy\">$fuzzy</td>"; - echo "\n\t<td class=\"untranslated\">$untranslated</td>"; - echo "\t</tr>"; + $report[$locale]=array ($color, $percent_done,$translated,$fuzzy,$untranslated); } } closedir($handle); + +function my_usort_function ($a, $b) { + if ($a[1] > $b[1]) { return -1; } + if ($a[1] < $b[1]) { return 1; } + return 0; +} + +uasort ($report, 'my_usort_function'); + +?> + +<html> +<body> +<head> + <link rel="stylesheet" type="text/css" href="g1-report.css"> +</head> +<h2>Localization Status Report for Gallery 1</h2> +<h2>Build : <?php echo $gallery->version ?></h2> +<table align="center" border="0" cellspacing="0" cellpadding="0"> +<tr> + <th>Language</th> + <th>Locale</th> + <th>Status</th> + <th valign="bottom" style="width: 30px;">T<br/>r<br/>a<br/>n<br/>s<br/>l<br/>a<br/>t<br/>e<br/>d</th> + <th valign="bottom" style="width: 30px;">F<br/>u<br/>z<br/>z<br/>y</th> + <th valign="bottom" style="width: 30px;">U<br/>n<br/>t<br/>r<br/>a<br/>n<br/>s<br/>l<br/>a<br/>t<br/>e<br/>d</th> +</tr> + +<?php +foreach ($report as $key => $value) { + echo "\n<tr>"; + echo "\n\t<td>". $nls['languages'][$key] . "</td>"; + echo "\n\t<td>". $key ."</td>"; + echo "\n\t<td style=\"background-color:#". $value[0] . "\">". $value[1] ."% done</td>"; + echo "\n\t<td class=\"translated\">". $value[2] ."</td>"; + echo "\n\t<td class=\"fuzzy\">". $value [3] . "</td>"; + echo "\n\t<td class=\"untranslated\">". $value[4] ."</td>"; + echo "\t</tr>"; +} ?> </table> </body> |