phpldapadmin/check_lang_files.php

47 lines
1.1 KiB
PHP
Raw Normal View History

2009-06-30 08:10:17 +00:00
2009-06-30 08:09:20 +00:00
<?php
2009-06-30 08:10:17 +00:00
// phpldapadmin/check_lang_files.php, $Revision: 1.4 $
2009-06-30 08:09:20 +00:00
2009-06-30 08:10:17 +00:00
echo "<html><head><title>phpldapadmin - check of translation</title></head><body>";
echo "<h1>Incomplete or Erroneous Language Files</h1>\n\n";
2009-06-30 08:09:20 +00:00
include realpath( 'lang/en.php' );
$english_lang = $lang;
unset( $lang );
$lang_dir = realpath( 'lang' );
$dir = opendir( $lang_dir );
while( ( $file = readdir( $dir ) ) !== false ) {
if( ! preg_match( "/\.php$/", $file ) )
continue;
2009-06-30 08:10:17 +00:00
if( $file == 'en.php' // is the mother of all language-files
|| $file == 'auto.php' // and ignore auto.php
)
2009-06-30 08:09:20 +00:00
continue;
echo "<h2>$file</h2>";
echo "<ol>";
unset( $lang );
$lang = array();
include realpath( $lang_dir.'/'.$file );
$has_errors = false;
foreach( $english_lang as $key => $string )
if( ! isset( $lang[ $key ] ) ) {
$has_errors = true;
echo "<li>missing entry: <tt>$key</tt></li>";
}
foreach( $lang as $key => $string )
if( ! isset( $english_lang[ $key ] ) ){
$has_errors = true;
echo "<li>extra entry: <tt>$key</tt></li>";
}
if( ! $has_errors )
echo "(No errors)";
echo "</ol>";
}
2009-06-30 08:10:17 +00:00
echo "</body></html>";
2009-06-30 08:09:20 +00:00
?>