本文整理汇总了PHP中Languages::getEmptyMessages方法的典型用法代码示例。如果您正苦于以下问题:PHP Languages::getEmptyMessages方法的具体用法?PHP Languages::getEmptyMessages怎么用?PHP Languages::getEmptyMessages使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Languages
的用法示例。
在下文中一共展示了Languages::getEmptyMessages方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: count
foreach ($wgLanguages->getLanguages() as $code) {
# Don't check English, RTL English or dummy language codes
if ($code == 'en' || $code == 'enRTL' || is_array($wgDummyLanguageCodes) && isset($wgDummyLanguageCodes[$code])) {
continue;
}
# Calculate the numbers
$language = Language::fetchLanguageName($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();
$output->element("{$language}");
$output->element("{$code}");
$output->element("{$fallback}");
$output->element("{$requiredMessagesNumber}/{$wgRequiredMessagesNumber}");
$output->element($requiredMessagesPercent);
$output->element("{$obsoleteMessagesNumber}/{$messagesNumber}");
$output->element($obsoleteMessagesPercent);
$output->element("{$problematicMessagesNumber}/{$messagesNumber}");