• Main Page
  • Related Pages
  • Modules
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

Services/XHTMLValidator/validator/translators.php

Go to the documentation of this file.
00001 <?php
00002 /* 
00003    +----------------------------------------------------------------------+
00004    | HTML/XML Validator                                                   |
00005    +----------------------------------------------------------------------+
00006    | Copyright (c) 2004-2005 Nuno Lopes                                   |
00007    +----------------------------------------------------------------------+
00008    | This program is free software; you can redistribute it and/or        |
00009    | modify it under the terms of the GNU Lesser General Public           |
00010    | License as published by the Free Software Foundation; either         |
00011    | version 2.1 of the License, or (at your option) any later version.   |
00012    |                                                                      |
00013    | This program is distributed in the hope that it will be useful,      |
00014    | but WITHOUT ANY WARRANTY; without even the implied warranty of       |
00015    | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU    |
00016    | Lesser General Public License for more details.                      |
00017    |                                                                      |
00018    | You should have received a copy of the GNU Lesser General Public     |
00019    | License along with this library; if not, write to the Free Software  |
00020    | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA             |
00021    | 02111-1307  USA.                                                     |
00022    +----------------------------------------------------------------------+
00023    |                     http://validator.aborla.net/                     |
00024    +----------------------------------------------------------------------+
00025 
00026 vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4:
00027 
00028      $Id: translators.php 8377 2005-08-15 09:27:49Z akill $
00029 */
00030 
00031 ini_set('default_charset', 'UTF-8');
00032 
00033 include './include.inc';
00034 include './local/en.inc';
00035 
00036 common_header('Translators');
00037 
00038 $files = scandir('./local');
00039 $files = array_splice($files, 2); // remove '.' and '..'
00040 $skip  = array('CVS'=>1, 'en.inc'=>1, 'convert.php'=>1);
00041 
00042 // fetch the english revision
00043 preg_match('/\$'.'Revision: 1\.(\d+)/', file_get_contents('./local/en.inc'), $data);
00044 $revision = $data[1];
00045 
00046 echo <<< HTML
00047 <p>&nbsp;</p>
00048 <p>This page is used to keep track of the current translations and their maintainers and revisions.
00049  Therefore we thank all the translators listed below for their work!</p>
00050 <p>If you would like to become the maintainer of the translation of a language, please download the
00051  <a href="/local/en.inc">english file</a> and translate it (please encode the file in UTF-8). Then, send the file
00052  and your details (name, site, e-mail) to our <a href="mailto:htmlchecker-devl@lists.sourceforge.net">mailling list</a>.</p>
00053 
00054 <p>English Revision: $revision</p>
00055 <table border='1'>
00056  <tr>
00057   <td>Language</td>
00058   <td>EN Revision</td>
00059   <td>Revision</td>
00060   <td>Translator</td>
00061   <td>E-mail</td>
00062   <td>Site</td>
00063  </tr>
00064 
00065 HTML;
00066 
00067 // iterate through the translated files
00068 foreach ($files as $file) {
00069 
00070     if (isset($skip[$file])) continue;
00071 
00072     $lang = explode('.', $file);
00073     $lang = $lang[0];
00074 
00075     $file   = file_get_contents("./local/$file");
00076     $rev    = $email = $site = $name = '';
00077     $en_rev = 0;
00078 
00079     if (preg_match('/\$'.'Revision: 1\.(\d+)/',  $file, $data))
00080         $rev = $data[1];
00081 
00082     if (preg_match('/EN-Revision: 1\.(\d+)/', $file, $data))
00083         $en_rev = $data[1];
00084 
00085     if(preg_match('/Translation:\s*([^(\r\n]+)\s*(\(.+\))?/',$file, $data)) {
00086         $name  = rtrim($data[1]);
00087 
00088         if (isset($data[2]) && preg_match_all('/\(([^)]+)\)/', $data[2], $contacts)) {
00089 
00090             foreach($contacts[1] as $contact) {
00091                 if(strpos($contact, '@'))
00092                     $email = str_replace(array('@', '.'), array(' -at- ', ' ! '), $contact);
00093                 else
00094                     $site  = $contact;
00095             }
00096         }
00097     }
00098 
00099     $diff = $revision - $en_rev;
00100     $lang = "{$langs[$lang]}  ($lang)";
00101 
00102     if ($diff == 0)
00103         $trclass = 'ok';
00104 
00105     else {
00106         $lang = "<a href='http://cvs.sourceforge.net/viewcvs.py/htmlchecker/validator/local/en.inc?tr1=1.$en_rev&amp;tr2=1.$revision&amp;r1=text&amp;r2=text&amp;diff_format=u'>$lang</a>";
00107 
00108         if ($diff <= 5)
00109             $trclass = 'old';
00110         else
00111             $trclass = 'critical';
00112     }
00113 
00114     $site  = $site ? "<a href='$site'>$site</a>" : '&nbsp;';
00115     $email = $email ? $email : '&nbsp;';
00116 
00117     echo <<< HTML
00118  <tr class="$trclass">
00119   <td>$lang</td>
00120   <td>$en_rev</td>
00121   <td>$rev</td>
00122   <td>$name</td>
00123   <td>$email</td>
00124   <td>$site</td>
00125  </tr>
00126 
00127 HTML;
00128 }
00129 ?>
00130 
00131 </table>
00132 
00133 <p>&nbsp;</p>
00134 
00135 <div class="centered"><table border="1">
00136  <tr>
00137   <td>Legend</td>
00138  </tr>
00139  <tr class="ok">
00140   <td>The translation is up-to-date!</td>
00141  </tr>
00142  <tr class="old">
00143   <td>The translation is a bit old (revisions &lt;= 5)</td>
00144  </tr>
00145  <tr class="critical">
00146   <td>The translation is highly outdated. Please update ASAP!</td>
00147  </tr>
00148 </table></div>
00149 
00150 <?php
00151 common_footer();
00152 ?>

Generated on Fri Dec 13 2013 17:57:03 for ILIAS Release_3_9_x_branch .rev 46835 by  doxygen 1.7.1