Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
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);
00040 $skip = array('CVS'=>1, 'en.inc'=>1, 'convert.php'=>1);
00041
00042
00043 preg_match('/\$'.'Revision: 1\.(\d+)/', file_get_contents('./local/en.inc'), $data);
00044 $revision = $data[1];
00045
00046 echo <<< HTML
00047 <p> </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
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&tr2=1.$revision&r1=text&r2=text&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>" : ' ';
00115 $email = $email ? $email : ' ';
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> </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 <= 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 ?>