<?php
  
require("../layout.php");
  
docstart();


# Translationdata contains all the statistics - it is uploaded by a script. See translationdata.phps for the source code.
require ("translationdata.php");

# This file contains a list of languages and a list of modules. See translationbasics.phps for the source code.
require ("translationbasics.php");

$data=gettranslationdata();
$lang=getlanguages();
$mod=getmoduleinfo();

echo 
"<h1>".htmlspecialchars(_("Available translations"))."</h1>\n";

echo 
"<p>".htmlspecialchars(_("This library is free for use for Delphi and Kylix developers."))."</p>\n";
echo 
"<p>".htmlspecialchars(_("If you improve one ".
  
"of the translations, or create new translations, please send it to "))."<a href=\"mailto:Lars@dybdahl.dk\">Lars@dybdahl.dk</a> to get it online here ".
  
"even if they are not complete. ".
  
"Maybe somebody else will make a translation complete if you start it.</p>\n";

echo 
_("<p><a href=\"translationlog.php\">The translation repository log</a> informs you about the most recent changes on this page.</a></p>\n");

echo 
"<h1>".htmlspecialchars(_("Overview table"))."</h1>\n";

echo 
"<p>".htmlspecialchars(_("Click the column headings (language codes) or the project to get more info."))."</p>\n";

echo 
"<table>\n";
echo 
"<tr><th>Module</th>";

ksort ($lang);
reset ($lang);
while (list(
$key,$value)=each($lang)) {
  if (
$key!="templates")
    echo 
"<th><a href=\"language.php?lang=$key\">".$key."</a></th>";
}
echo 
"</tr>\n";

reset ($mod);
while (list(
$key,$value)=each($mod)) {
  echo 
"<tr><td>";
  echo 
"<a href=\"module.php?mod=".$key."\">".htmlspecialchars(_($value["shortname"]))."</a>";
  echo 
"</td>";
  
reset ($lang);
  while (list(
$lkey,$lvalue)=each($lang)) {
    if (
$lkey!="templates") {
      
$entry=$data[$lkey][$key];
      if (
$entry["total"]==|| $entry["total"]==""$pct=".";
      else 
$pct=100*$entry["translated"]/$entry["total"];
      echo 
"<td";
      if (
$pct==100) {
        echo 
" bgcolor=\"#80ff80\"";
        
$pct=_("OK");
      } else
      if (
$entry["translated"]>0) {
        echo 
" align=\"right\" bgcolor=\"#ffff00\"";
        
$pct=number_format($pct,0)."%";
      } else
      echo 
" bgcolor=\"#ffe0e0\"";
      echo 
">".htmlspecialchars($pct)."</td>";
    }
  }
  echo 
"</tr>\n";
}
echo 
"</table>\n";


echo 
"<p><a href=\"index.phps\">".htmlspecialchars(_("View sourcecode of this webpage"))."</a></p>\n";

#echo "<h1>".htmlspecialchars(_("Downloads"))."</h1>\n";

#echo "<ul>\n";
#echo "<li><a href=\"http://prdownloads.sourceforge.net/dxgettext/translations-2003-04-02.zip?download\">";
#echo "Download compiled translation kit for Delphi runtime library, VCL, CLX, etc.</a> ";
#echo "(French, German, Russian, Portuguese, Danish, Spanish, Dutch, Italian)</li>";
#echo "</ul>\n";



echo "<h1>".htmlspecialchars(_("Translation repositories"))."</h1>\n";

echo 
"<ul>\n";
echo 
"<li><a href=\"http://www.iro.umontreal.ca/contrib/po/trans/\">";
echo 
htmlspecialchars(_("Linux program translations"))."</a></li>\n";
echo 
"<li><a href=\"http://i18n.kde.org/po_overview/\">";
echo 
htmlspecialchars(_("KDE translations"))."</a></li>\n";
echo 
"</ul>\n";





echo 
"<h1>".htmlspecialchars(_("Translators"))."</h1>\n";

echo 
"<p>".htmlspecialchars(_("This list is sorted by the amount of translations that carries their name."))."</p>";

reset ($data);
while (list(
$key,$value)=each($data)) {
  
reset ($value);
  while (list(
$key2,$value2)=each($value)) {
    if (
$key2!="templates") {
      
$translator=trim($value2["translator"]);
      
$translated=trim($value2["translated"]);
      if (
$translated=="" || $translated<1$translated=1;
      if (
$translator!="") {
        
$ov=$tlist[$translator];
        if (
$ov=="") {
          
$tlist[$translator]=$translated;
        }
        else 
$tlist[$translator]=$ov+$translated;
        
$langlist[$translator][$key]=1;
      }
    }
  }
}

arsort ($tlist);

echo 
"<ul>";
$first=1;
reset ($tlist);
while (list(
$key,$value)=each($tlist)) {
  
$langs="";
  while (list(
$lkey,$lvalue)=each($langlist[$key])) {
    if (
$langs!=""$langs=$langs.", ";
    
$langs=$langs.$lkey;
  }
  if (
$langs!="templates")
    echo 
"<li>".htmlspecialchars($key." (".$langs.")")."</li>\n";
  
$first=0;
}
echo 
"</ul>\n";
  
docend();
?>