}
# Languages
-$wgLanguages = new Languages();
+$languages = new Languages();
# Header
$output->heading();
$output->element( '%', true );
$output->blockend();
-$wgGeneralMessages = $wgLanguages->getGeneralMessages();
+$wgGeneralMessages = $languages->getGeneralMessages();
$wgRequiredMessagesNumber = count( $wgGeneralMessages['required'] );
-foreach ( $wgLanguages->getLanguages() as $code ) {
+foreach ( $languages->getLanguages() as $code ) {
# Don't check English, RTL English or dummy language codes
if ( $code == 'en' || $code == 'enRTL' || ( is_array( $wgDummyLanguageCodes ) &&
isset( $wgDummyLanguageCodes[$code] ) )
# Calculate the numbers
$language = Language::fetchLanguageName( $code );
- $fallback = $wgLanguages->getFallback( $code );
- $messages = $wgLanguages->getMessages( $code );
+ $fallback = $languages->getFallback( $code );
+ $messages = $languages->getMessages( $code );
$messagesNumber = count( $messages['translated'] );
$requiredMessagesNumber = count( $messages['required'] );
$requiredMessagesPercent = $output->formatPercent(
$messagesNumber,
true
);
- $messagesWithMismatchVariables = $wgLanguages->getMessagesWithMismatchVariables( $code );
- $emptyMessages = $wgLanguages->getEmptyMessages( $code );
- $messagesWithWhitespace = $wgLanguages->getMessagesWithWhitespace( $code );
- $nonXHTMLMessages = $wgLanguages->getNonXHTMLMessages( $code );
- $messagesWithWrongChars = $wgLanguages->getMessagesWithWrongChars( $code );
+ $messagesWithMismatchVariables = $languages->getMessagesWithMismatchVariables( $code );
+ $emptyMessages = $languages->getEmptyMessages( $code );
+ $messagesWithWhitespace = $languages->getMessagesWithWhitespace( $code );
+ $nonXHTMLMessages = $languages->getNonXHTMLMessages( $code );
+ $messagesWithWrongChars = $languages->getMessagesWithWrongChars( $code );
$problematicMessagesNumber = count( array_unique( array_merge(
$messagesWithMismatchVariables,
$emptyMessages,
exit( 1 );
}
+$lang = Language::factory( 'en' );
$title = Title::newFromText( $args[0] );
if ( isset( $options['start'] ) ) {
$start = wfTimestamp( TS_MW, strtotime( $options['start'] ) );
- echo "Starting from " . $wgLang->timeanddate( $start ) . "\n";
+ echo "Starting from " . $lang->timeanddate( $start ) . "\n";
} else {
$start = '19700101000000';
}
$type,
count( $hashes ),
$uncompressedSize / strlen( $serialized ),
- $wgLang->formatSize( $uncompressedSize ),
+ $lang->formatSize( $uncompressedSize ),
strlen( $serialized )
);
printf( "Compression time: %5.2f ms\n", $t * 1000 );
}
}
- $wgLang = Language::factory( 'en' );
+ $lang = Language::factory( 'en' );
+ // Set global language to ensure localised errors are in English (bug 20633)
+ RequestContext::getMain()->setLanguage( $lang );
+ $wgLang = $lang; // BackCompat
define( 'MW_UPDATER', true );
$time2 = microtime( true );
- $timeDiff = $wgLang->formatTimePeriod( $time2 - $time1 );
+ $timeDiff = $lang->formatTimePeriod( $time2 - $time1 );
$this->output( "\nDone in $timeDiff.\n" );
}