Exemplo n.º 1
0
$output->element('%', true);
$output->element('Obsolete', true);
$output->element('%', true);
$output->element('Problematic', true);
$output->element('%', true);
$output->blockend();
$wgGeneralMessages = $wgLanguages->getGeneralMessages();
$wgRequiredMessagesNumber = count($wgGeneralMessages['required']);
foreach ($wgLanguages->getLanguages() as $code) {
    # Don't check English or RTL English
    if ($code == 'en' || $code == 'enRTL') {
        continue;
    }
    # Calculate the numbers
    $language = $wgContLang->getLanguageName($code);
    $fallback = $wgLanguages->getFallback($code);
    $messages = $wgLanguages->getMessages($code);
    $messagesNumber = count($messages['translated']);
    $requiredMessagesNumber = count($messages['required']);
    $requiredMessagesPercent = $output->formatPercent($requiredMessagesNumber, $wgRequiredMessagesNumber);
    $obsoleteMessagesNumber = count($messages['obsolete']);
    $obsoleteMessagesPercent = $output->formatPercent($obsoleteMessagesNumber, $messagesNumber, true);
    $messagesWithMismatchVariables = $wgLanguages->getMessagesWithMismatchVariables($code);
    $emptyMessages = $wgLanguages->getEmptyMessages($code);
    $messagesWithWhitespace = $wgLanguages->getMessagesWithWhitespace($code);
    $nonXHTMLMessages = $wgLanguages->getNonXHTMLMessages($code);
    $messagesWithWrongChars = $wgLanguages->getMessagesWithWrongChars($code);
    $problematicMessagesNumber = count(array_unique(array_merge($messagesWithMismatchVariables, $emptyMessages, $messagesWithWhitespace, $nonXHTMLMessages, $messagesWithWrongChars)));
    $problematicMessagesPercent = $output->formatPercent($problematicMessagesNumber, $messagesNumber, true);
    # Output them
    $output->blockstart();