[GRASSweb-list] markus: web/grass62 i18n.inc, NONE, 1.1 i18n.php, NONE, 1.1 i18n_stats.inc, NONE, 1.1 main.inc, 1.10, 1.11

grass at intevation.de grass at intevation.de
Fri Oct 27 09:38:32 EDT 2006


Author: markus

Update of /grassrepository/web/grass62
In directory doto:/tmp/cvs-serv22406

Modified Files:
	main.inc 
Added Files:
	i18n.inc i18n.php i18n_stats.inc 
Log Message:
generate translation stats for 6.2 as well

--- NEW FILE: i18n.inc ---
<!-- MN -->

<?php
      include("i18n_stats.inc");
?>

<div align="right">
<i>Last change: $Date: 2006/10/27 13:38:30 $ </i><br>
<i>$Author: markus $</i>
</div>


--- NEW FILE: i18n.php ---
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <title>GRASS GIS: GRASS messages translation project (i18N)</title>
  <meta name="robots" content="index,follow">
  <meta name="description"
        content="GRASS GIS (Geographic Resources
         Analysis Support System) is an open source, free software
         Geographical Information System (GIS) with raster, topological
         vector, image processing, and visualization functionality">
  <meta name="keywords"
        content="gis, GIS, GRASS, open source, 
	 free software, Geographical Information System, raster, topology,
         vector, image processing, visualization">
  <meta name="Author" content="MN/GRASS Development Team">
  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  <link rel="stylesheet" href="../sitestyle.css" type="text/css">
</head>
<body>
   <!-- TOP LOGO LINE -->  
<table bgcolor="#ffffff" cellspacing="0" cellpadding="0" border="0" width="650">
 <tbody>
 <tr><td>            
   <table cellspacing="1" cellpadding="0" border="0" width="100%" >
   <tbody>
      <tr bgcolor="#ffffff">
       <td nowrap="nowrap"> <img src="../images/grasslogo_vector_small.png" alt="GRASS GIS (Geographic Resources Analysis Support System)" hspace="22">
       </td>
       <td nowrap="nowrap">
          <table cellspacing="0" cellpadding="1" border="0" width="50%">
          <tbody>
            <tr bgcolor="#ffffff">
              <td nowrap="nowrap">
               <?php
                  include("title.inc");
               ?> 
              </td>
            </tr>
          </tbody>
          </table>
       </td>
      </tr>
    </tbody>
    </table>
   </td>
  </tr>
 </tbody> 
</table>

<table cellspacing="0" cellpadding="1" border="0" width="100%">
<tbody>
 <tr>
    <td valign="top">
    <?php
        include("../menu_search.inc");
     ?> 
   </td>
   <td valign="top">
     <?php
       include("../menu_top.inc");
     ?>
   </td>
 </tr>
 <tr>
  <td valign="top">
     <?php
       include("menu_side.inc");
     ?>
   </td>
  <td valign="top" class="leftmenu"> <!-- MAIN PART -->
       
    <?php
      include("i18n.inc");
    ?>			     
    <!-- END MAIN PART -->
 
  </td>
 </tr>  
 </tbody> 
</table>

<hr>
   <div align="right">&copy; 2004-2006 GRASS Development Team<br>
   <a href="../impressum.html">Imprint</a> |
   <a href="../contact.php">Comments</a> about this page<br>
   </div>
		    
</body>
</html>

--- NEW FILE: i18n_stats.inc ---
<?php

error_reporting(E_ALL ^ E_NOTICE);
// i18n_stats.php - 2005 Stephan Holl, http://www.GDF-Hannover.de

//------------------------------------------------------------------------
// function zur Erstellung der tabellen
// function to create the tables
function generate_table($file) {
	
	$last_modified = filemtime($file);
	// einlesen der Datei - read in data
	$array = file($file);
	
	// read in the iso-table
	$array_iso = file("../devel/iso_639-1.txt");
	
	// extract the relevant columns
	$array_iso2 = array(); /*iso-kuerzel*/
	$array_iso3 = array(); /*Klartext-name*/
	$array_iso1 = array();
	foreach($array_iso as $id => $value) {
		$array_iso1 = explode("\"", $value);
		// neue arrays schreiben - write new arrays
		array_push($array_iso2, $array_iso1[7]);
		array_push($array_iso3, $array_iso1[1]);
	}
	foreach($array_iso2 as $key => $value) {
// 		echo $key . " ";
		$new[$array_iso2[$key]] .= $array_iso3[$key];
		
	}
	?>
	<P>
	<table border="1" width="50%">
	<tr>
		<th colspan="2">PO-Files</th><th>Translated<br>messages</th><th>Fuzzy<br>translations</th><th>Untranslated<br> messages</th>
	</tr>	
	<?php
	$arr2 = array();
	$arr3 = array();
	$arr4 = array();
	$arr5 = array();
	foreach($array as $lines => $value) {
		// array an Leerzeichen unterteilen
		// space delimited array
		$split = explode(" ", $value);
		// neues Array jeweils für die einzelnen Spalten schreiben
		// write new array for each column
		array_push($arr2, $split[0]);
		array_push($arr3, $split[1]);
		array_push($arr4, $split[4]);
		array_push($arr5, $split[7]);
	}
	
	// Sortieren der Spalte 2 
	// sort by split 2 ?
	arsort($arr3, SORT_ASC);
	// ausgabe in tabelle basteln
	// output table (?)
	foreach($arr3 as $names => $values) {
		$split2 = explode("_", $arr2[$names]);
		$split3 = explode(".", $split2[1]);
		echo "<tr>\n";
		echo "<td>" .$new[$split3[0]]. "</td>\n";
		echo "<td>" . $arr2[$names] . "</td>\n";
		echo "<td align=\"center\" bgcolor=\"#c5e2ca\">" . $values . "</td>\n";
		echo "<td align=\"center\">" . $arr4[$names] . "&nbsp;</td>\n";
		echo "<td align=\"center\">" . $arr5[$names] . "&nbsp;</td></tr>\n";
	}
	?>
	</table>
	<br>
	This table is generated weekly -
	<?php
	// Generate timestamp (use h:ia for a.m./p.m. )
	print " -  last update: " . date("l, dS F, Y @ H:i.", $last_modified);
} // End of function generate_table()
//----------------------------------------------------------------

// Ausgabedatei erzeugen für den Cronjob (Pfad anpassen):
// $file = "../grass63/binary/linux/snapshot/i18n_stats.txt";
// Präprocessing: cat i18n_stats.txt|grep mod > out.mods
// Präprocessing: cat i18n_stats.txt|grep lib > out.libs
// Pr�rocessing: cat i18n_stats.txt|gretcl > out.tcl
$file_libs="binary/linux/snapshot/i18n_stats_libs.txt";
$file_mods="binary/linux/snapshot/i18n_stats_mods.txt";
$file_tcl="binary/linux/snapshot/i18n_stats_tcl.txt";
// $file_libs="/tmp/i18n_stats_libs.txt";
// $file_mods="/tmp/i18n_stats_mods.txt";

?>

<a name="statistics"></a>
<h2>Statistics of GRASS 6.2 internationalization (i18N) status</h2>

The table is ordered by number of translated messages per language.
The two character codes indicate the language, based on the Alpha-2 code of
<a href="http://www.loc.gov/standards/iso639-2/englangn.html">ISO 639-1</a>.
For download of a currently sleeping translation, please either get the
file directly from the GRASS-CVS or see above.
<?php
// ausgabe in HTML-Tabelle durch Funktion generate_table()
// output in HTML table through function generate_table()
echo "<h2>GRASSLIBS</h2>\n";
generate_table($file_libs);

echo "<h2>GRASSMODS</h2>\n";
generate_table($file_mods);

echo "<h2>GRASSTCL</h2>\n";
generate_table($file_tcl);

?>

<br>
The relevant column is 'Translated messages' as the message files
do not necessarily contain all available messages of GRASS.

</html>

Index: main.inc
===================================================================
RCS file: /grassrepository/web/grass62/main.inc,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- main.inc	23 Oct 2006 22:38:21 -0000	1.10
+++ main.inc	27 Oct 2006 13:38:30 -0000	1.11
@@ -42,3 +42,9 @@
  <li> <a href="../devel/index.php#prog">GRASS 6 Programmer's Manual</a>
 </ul>
 
+<a name="translation"></a>
+<h2>Translation statistics</h2>
+<ul>
+ <li> <a href="i18n.php">Statistics of GRASS 6.2.x message translation efforts</a>
+</ul>
+





More information about the grass-web mailing list