[GRASSweb-list]stephan: web/devel iso_639-1.txt,NONE,1.1 i18n_stats.inc,1.13,1.14

grass at intevation.de grass at intevation.de
Wed Jan 18 03:50:01 EST 2006


Author: stephan

Update of /grassrepository/web/devel
In directory doto:/tmp/cvs-serv23281

Modified Files:
	i18n_stats.inc 
Added Files:
	iso_639-1.txt 
Log Message:
+ merged iso-names into statistics table.



--- NEW FILE: iso_639-1.txt ---
(This appears to be a binary file; contents omitted.)

Index: i18n_stats.inc
===================================================================
RCS file: /grassrepository/web/devel/i18n_stats.inc,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- i18n_stats.inc	14 Dec 2005 19:46:10 -0000	1.13
+++ i18n_stats.inc	18 Jan 2006 08:49:58 -0000	1.14
@@ -9,11 +9,26 @@
 	// einlesen der Datei
 	$array = file($file);
 	
+	// read in the iso-table
+	$array_iso = file("./iso_639-1.txt");
+	
+	// extract the relevant columns
+	$array_iso2 = array(); /*iso-kuerzel*/
+	$array_iso3 = array(); /*Klartext-name*/
+	foreach($array_iso as $id => $value) {
+		$array_iso1 = explode("\"", $value);
+		// neue arrays schreiben
+		array_push($array_iso2, $array_iso1[7]);
+		array_push($array_iso3, $array_iso1[1]);
+	}
+	foreach($array_iso2 as $key => $value) {
+		$new[$array_iso2[$key]] .= $array_iso3[$key];
+	}
 	?>
 	<P>
 	<table border="1" width="50%">
 	<tr>
-		<th>PO-Files</th><th>Translated<br>messages</th><th>Fuzzy<br>translations</th><th>Untranslated<br> messages</th>
+		<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();
@@ -29,11 +44,16 @@
 		array_push($arr4, $split[4]);
 		array_push($arr5, $split[7]);
 	}
+	
 	// Sortieren der Spalte 2 
 	arsort($arr3, SORT_ASC);
 	// ausgabe in tabelle basteln
 	foreach($arr3 as $names => $values) {
-		echo "<tr><td>" . $arr2[$names] . "</td>\n";
+		$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";





More information about the grass-web mailing list