当前位置: 首页>>代码示例>>PHP>>正文


PHP Languages::getEmptyMessages方法代码示例

本文整理汇总了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}");
开发者ID:jpena88,项目名称:mediawiki-dokku-deploy,代码行数:31,代码来源:transstat.php


注:本文中的Languages::getEmptyMessages方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。