perms('manage_project')) {
Flyspray::show_error(28);
}
ob_start();
?>
Diff report for language ',$lang,'',"\n";
echo '
The following translation keys are missing in the translation:
';
echo '';
$i = 0;
foreach ($orig_language as $key => $val) {
if (!isset($translation[$key])) {
echo '',$key,' | '.htmlspecialchars($val).' |
',"\n";
$i++;
}
}
echo '
';
if ( $i > 0 ){
echo '',$i,' out of ',sizeof($language),' keys to translate.
';
}
echo 'The following translation keys should be deleted from the translation:
';
echo '';
$i = 0;
foreach ($translation as $key => $val) {
if ( !isset($orig_language[$key])) {
echo '',$key,' | \'',$val,'\' |
',"\n";
$i++;
}
}
echo '
';
if ( $i > 0 ){
echo ''.$i.' entries can be removed from this translation.
';
} else{
echo ' None
';
}
echo 'Direct comparision between english and '.htmlspecialchars($lang).'
';
echo '
translation key |
en |
'.htmlspecialchars($lang).' |
';
$i = 0;
foreach ($orig_language as $key => $val) {
if (!isset($translation[$key])) {
echo '',$key,' | '.htmlspecialchars($val).' | |
'."\n";
}else{
echo '
',$key,' | '.htmlspecialchars($val).' |
'.htmlspecialchars($translation[$key]).' |
'."\n";
}
$i++;
}
echo '
';
} else {
# TODO show all existing translations overview and selection
# readdir
$english=$language;
$max=count($english);
$langfiles=array();
$workfiles=array();
if ($handle = opendir('lang')) {
$languages=array();
while (false !== ($file = readdir($handle))) {
if ($file != "."
&& $file != ".."
&& $file!='.langdiff.php'
&& $file!='.langedit.php'
&& !(substr($file,-4)=='.bak')
&& !(substr($file,-5)=='.safe') ) {
# if a .$lang.php.work file but no $lang.php exists yet
if( substr($file,-5)=='.work'){
if(!is_file('lang/'.substr($file,1,-5)) ){
$workfiles[]=$file;
}
} else{
$langfiles[]=$file;
}
}
}
asort($langfiles);
asort($workfiles);
echo '';
}
}
$content = ob_get_contents();
ob_end_clean();
$page->uses('content');
$page->pushTpl('admin.translation.tpl');
?>