website rev 659
mailing-list.html: add language support in archive index
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Tue Sep 28 17:53:15 2010 +0200 (2010-09-28) |
parents | 6666787363ca |
children | f93c9c6f5b56 |
files | archives.php de/mailing-list.html es/mailing-list.html fr/mailing-list.html pt/mailing-list.html |
line diff
1.1 --- a/archives.php Mon Sep 27 18:28:13 2010 +0200 1.2 +++ b/archives.php Tue Sep 28 17:53:15 2010 +0200 1.3 @@ -33,12 +33,70 @@ 1.4 </style> 1.5 </head> 1.6 <body> 1.7 -<h4>Archives 2007-<?php 1.8 -echo date('Y').'</h4>'; 1.9 +<?php 1.10 + 1.11 +function translate($word) 1.12 +{ 1.13 + if (isset($_GET['lang'])) switch ($_GET['lang']) { 1.14 + case "de" : 1.15 + switch ($word) { 1.16 + case "Archives" : return "Archiv"; 1.17 + case "Archive" : return "Archiv"; 1.18 + case "View by" : return "Ansicht von"; 1.19 + case "Number" : return "Zahl"; 1.20 + case "Total size": return "Gesamtgr\ö\ße"; 1.21 + case " or " : return " oder "; 1.22 + case "Date" : return "datum"; 1.23 + } 1.24 + break; 1.25 + case "es" : 1.26 + switch ($word) { 1.27 + case "Archives" : return "Archivos"; 1.28 + case "Archive" : return "Archivo"; 1.29 + case "View by" : return "Vista"; 1.30 + case "Number" : return "n\úmero"; 1.31 + case "Total size": return "Tama\ño total"; 1.32 + case "Thread" : return "hilo"; 1.33 + case " or " : return " o "; 1.34 + case "Date" : return "Fecha"; 1.35 + } 1.36 + break; 1.37 + case "fr" : 1.38 + switch ($word) { 1.39 + case "View by" : return "Affich\é par"; 1.40 + case "Number" : return "Nombre"; 1.41 + case "Total size": return "Volume"; 1.42 + case "Thread" : return "Sujet"; 1.43 + case " or " : return " ou "; 1.44 + } 1.45 + break; 1.46 + case "pt" : 1.47 + switch ($word) { 1.48 + case "Archives" : return "Arquivos"; 1.49 + case "Archive" : return "Arquivo"; 1.50 + case "View by" : return "Exibir por"; 1.51 + case "Number" : return "n\úmero"; 1.52 + case "Total size": return "O tamanho total"; 1.53 + case "Thread" : return "T\ópico"; 1.54 + case " or " : return " ou "; 1.55 + case "Date" : return "Data"; 1.56 + } 1.57 + break; 1.58 + } 1.59 + return $word; 1.60 +} 1.61 + 1.62 +echo '<h4>'.translate("Archives").' 2007-'.date('Y')."</h4>\n"; 1.63 + 1.64 $url = "http://listengine.tuxfamily.org/lists.tuxfamily.org/slitaz/"; 1.65 + 1.66 $script = "-e '/<table>/,/<\/table>/!d' "; 1.67 $script .= "-e 's|html\"|html\" target=\"_blank\"|g' "; 1.68 $script .= "-e 's|href=\"|href=\"$url|g' "; 1.69 +foreach (array("Archive","View by","Number","Total size", 1.70 + "Thread"," or ","Date") as $word) { 1.71 + $script .= "-e 's|".$word."|".translate($word)."|' "; 1.72 +} 1.73 system("wget -q -O - $url | sed $script"); 1.74 ?> 1.75 </body>
2.1 --- a/de/mailing-list.html Mon Sep 27 18:28:13 2010 +0200 2.2 +++ b/de/mailing-list.html Tue Sep 28 17:53:15 2010 +0200 2.3 @@ -176,7 +176,7 @@ 2.4 </p> 2.5 2.6 <div> 2.7 -<object type="text/html" width="100%" height="345" data="../archives.php"> 2.8 +<object type="text/html" width="100%" height="345" data="../archives.php?lang=de"> 2.9 </object> 2.10 </div> 2.11
3.1 --- a/es/mailing-list.html Mon Sep 27 18:28:13 2010 +0200 3.2 +++ b/es/mailing-list.html Tue Sep 28 17:53:15 2010 +0200 3.3 @@ -177,7 +177,7 @@ 3.4 </p> 3.5 3.6 <div> 3.7 -<object type="text/html" width="100%" height="345" data="../archives.php"> 3.8 +<object type="text/html" width="100%" height="345" data="../archives.php?lang=es"> 3.9 </object> 3.10 </div> 3.11
4.1 --- a/fr/mailing-list.html Mon Sep 27 18:28:13 2010 +0200 4.2 +++ b/fr/mailing-list.html Tue Sep 28 17:53:15 2010 +0200 4.3 @@ -195,7 +195,7 @@ 4.4 </p> 4.5 4.6 <div> 4.7 -<object type="text/html" width="100%" height="345" data="../archives.php"> 4.8 +<object type="text/html" width="100%" height="345" data="../archives.php?lang=fr"> 4.9 </object> 4.10 </div> 4.11
5.1 --- a/pt/mailing-list.html Mon Sep 27 18:28:13 2010 +0200 5.2 +++ b/pt/mailing-list.html Tue Sep 28 17:53:15 2010 +0200 5.3 @@ -192,7 +192,7 @@ 5.4 </p> 5.5 5.6 <div> 5.7 -<object type="text/html" width="100%" height="345" data="../archives.php"> 5.8 +<object type="text/html" width="100%" height="345" data="../archives.php?lang=pt"> 5.9 </object> 5.10 </div> 5.11