// Copyright (C) 2003-2004 Tim Dijkstra
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// # You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
// FUNCTION:
// Acest script afişează informaţile extrase din mesajele de poştă trimise la
// debian-l10n-romanian@l.d.o care conţin pseudo-urls. Informaţia este extrasă
// şi introdusă într-o bază de date MySQL de alt ptogram, l10n-bot. Acest script
// arată ultimul articol al unei traduceri date, dacă utilizatorul nu specifică
// altfel. Este de asemenea posibil să sortăm lista după nume, traducător, stare
// sau dată.
//
?>
Cordonare debian-l10n-romanian
Cordonare debian-l10n-romanian
Această pagină este destinată coordonării traducerilor textelor legate de debian în română. Aşa cum e documentat aici, traducerile şi reviziile folosesc pentru coordonare pseudo-urls în subiectul mesajelor de poştă trimise pe lista debian-l10n-romanian.
Un program serializează aceste pseudo-urls şi colectează datele relevante, care ulterior sunt afişate mai jos. În cazul mesajelor RFR/LCFC se uită de asemenea şi după fişierul ataşat cu extensia corectă (po,wml) Nu ştiu cum funcţionează traducerea paginilor man.
| Nume | Traducător | Stare | Dată | Fişier | |
$expanded=explode(",",$history);
// Only sorting on a few things is allowed.
if(!in_array($sort,array('status','date','name','translator'))){$sort='name';}
// Make a compare function on-the-fly, used to sort the array
if($sort!='status'){
$cmpfunc=create_function('$a,$b',"return strcmp(\$a[$sort],\$b[$sort]);");
} else {
function comp_status ($a,$b){
$stati = array('ITT','RFR','RFR2','LCFC','BTS','DONE');
return array_search($a['status'],$stati) > array_search($b['status'],$stati);
}
$cmpfunc="comp_status";
}
$link=mysql_connect("localhost","USER","PASSWORD");
mysql_select_db("debian");
// Get everything from the db
$res=mysql_query($sql="SELECT id,name,status,type,translator,date,file,bugnr FROM translation ORDER BY type,name,date,status ");
// Loop over it
while(($var=mysql_fetch_assoc($res)) or $old[0]){
// If the former record doesn't have the same name, that was the last
// record for this 'name'.
if(isset($old) && ($var['name']!=$old[0]['name'])){
// Skip done if > 2 weeks ago 1209600
if(!( ($old[count($old)-1]['status']=="DONE") and (isset($nodone) or $old[count($old)-1]['date']";
$cur_name=$old[0]['name'];
// If the user wants to see the history of the translation
// We'll put all records of the same name in an array and append it to
// the last record. Only this record will end up in the data array
// This way we can still sort on 'name'
if(in_array($old[0]['name'],$expanded)){
for($i=1;$i-";
$old[0]['class']=$old[count($old)-1]['status'];
$old[count($old)-1]['history']=$old;
$data[]=array_pop($old);
$data[count($data)-1]['name']=$cur_name;
} else {
// Else we'll only keep the last
$old[count($old)-1]['button']="+";
$data[]=array_pop($old);
}
}
unset($old);
}
// If the former record has a diff type, we can process the former type.
if(isset($data) && ($var['type']!=$data[0]['type'])){
echo "{$data[0]['type']} |
";
// Sort the array
usort($data,$cmpfunc);
// Loop over all 'name's
for($i=0;$data[$i];$i++){
// If we have a history, put the records of the 'history' in the
// data array, so it will also be printed.
if($data[$i]['history']){
array_splice($data,$i,1,$data[$i]['history']);
}
// Process the fields a bit
$data[$i]['translator']=htmlentities($data[$i]['translator']);
$data[$i]['date']=preg_replace("/(\d{4})(\d{2})(\d{2}).*/","\\1-\\2-\\3",$data[$i]['date']);
$data[$i]['class']=($data[$i]['class']?$data[$i]['class']:$data[$i]['status']);
// If status is BTS, make a link.
$data[$i]['status']=($data[$i]['status']=="BTS" && $data[$i]['bugnr']?"BTS":$data[$i]['status']);
// If we have a file, make link. File was saved as $id.$exts
$data[$i]['file']=($data[$i]['file']?"[{$data[$i]['file']}]":"");
// Print a row
echo
"".
"".
"{$data[$i]['button']}".
" | ".
"{$data[$i]['name']} | ".
"{$data[$i]['translator']} | ".
"{$data[$i]['status']} | ".
"{$data[$i]['date']} | ".
"{$data[$i]['file']} | ".
"
\n";
}
unset($old);
unset($data);
}
// Make the current record the former.
$old[]=$var;
}
mysql_close($link);
?>
Comentarii: webmaster