#
# Known bugs:
# - File paths are hardcoded
-# - Can't check your configured language.(says nothing is localised)
#
include_once( "../includes/Setup.php" );
include_once( "../install-utils.inc" );
+$wgLanguageCode = strtoupper(substr($wgLanguageCode,0,1)).strtolower(substr($wgLanguageCode,1));
+
# read command line argument
if ( isset($argv[1]) ) {
$lang = $argv[1];
# or prompt a simple menu
} else {
$loop = true;
- print "Enter the language you want to check [$wgLanguageCode]:";
do {
@ob_end_flush();
+ print "Enter the language you want to check [$wgLanguageCode]:";
$input = readconsole();
# set the input to current language
$input = $wgLanguageCode;
}
+ # convert to 1st char upper, rest lower case
+ $input = strtoupper(substr($input,0,1)).strtolower(substr($input,1));
+
# try to get the file
if( file_exists("../Languages/Language$input.php") ) {
$loop = false;
$lang = $input;
+ } else {
+ print "ERROR: The file Language$input.php doesn't exist !\n";
}
+
} while ($loop);
}
# include the language if it's not the already loaded one
if($lang != $wgLanguageCode) {
print "Including language file for $lang.\n";
-
include("Language{$lang}.php");
}
# Get all references messages and check if they exist in the tested language
$i = 0;
-print "Checking $lang localisation file against reference (en):\n----\n";
+print "\nChecking $lang localisation file against reference (en):\n----\n";
foreach($wgAllMessagesEn as $index => $localized)
{
if(!(isset($testme[$index]))) {
}
}
echo "----\n";
-echo (100 - $i/count($wgAllMessagesEn) * 100)."% completed\n";
-echo "$i unlocalised of the ".count($wgAllMessagesEn)." messages available.\n";
+echo "$lang language is complete at ".(100 - $i/count($wgAllMessagesEn) * 100)."%\n";
+echo "$i unlocalised message of the ".count($wgAllMessagesEn)." messages available.\n";