本文整理汇总了PHP中mt函数的典型用法代码示例。如果您正苦于以下问题:PHP mt函数的具体用法?PHP mt怎么用?PHP mt使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了mt函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: evaluate
protected function evaluate()
{
$phpVersion = Platform::getPhpVersion();
$this->setStateText(sprintf(mt('setup', 'You are running PHP version %s.'), $phpVersion));
list($operator, $requiredVersion) = $this->getCondition();
return version_compare($phpVersion, $requiredVersion, $operator);
}
示例2: getCount
/**
* {@inheritdoc}
*/
public function getCount()
{
if ($this->count === null) {
try {
$count = 0;
$programStatus = $this->isCurrentlyRunning();
$titles = array();
if (!(bool) $programStatus->notifications_enabled) {
$count = 1;
$this->state = static::STATE_WARNING;
$titles[] = mt('monitoring', 'Notifications are disabled');
}
if (!(bool) $programStatus->is_currently_running) {
$count = 1;
$this->state = static::STATE_CRITICAL;
array_unshift($titles, sprintf(mt('monitoring', 'Monitoring backend %s is not running'), MonitoringBackend::instance()->getName()));
}
$this->count = $count;
$this->title = implode('. ', $titles);
} catch (Exception $_) {
$this->count = 1;
}
}
return $this->count;
}
示例3: getSummary
/**
* Get the problem data for the summary
*
* @return array|null
*/
public function getSummary()
{
if (!$this->isCurrentlyRunning()) {
return array('problems' => 1, 'title' => sprintf(mt('monitoring', 'Monitoring backend %s is not running'), MonitoringBackend::instance()->getName()));
}
return null;
}
示例4: evaluate
protected function evaluate()
{
list($configDirective, $value) = $this->getCondition();
$configValue = Platform::getPhpConfig($configDirective);
$this->setStateText($configValue ? sprintf(mt('setup', 'The PHP config `%s\' is set to "%s".'), $configDirective, $configValue) : sprintf(mt('setup', 'The PHP config `%s\' is not defined.'), $configDirective));
return is_bool($value) ? $configValue == $value : $configValue === $value;
}
示例5: render
/**
* {@inheritdoc}
*/
public function render()
{
if ($this->getInnerIterator()->isEmpty()) {
return '<p>' . mt('doc', 'Documentation is empty.') . '</p>';
}
$view = $this->getView();
$zendUrlHelper = $view->getHelper('Url');
foreach ($this as $section) {
$path = $zendUrlHelper->url(array_merge($this->urlParams, array('chapter' => $this->encodeUrlParam($section->getChapter()->getId()))), $this->url, false, false);
$url = $view->url($path);
/** @var \Icinga\Web\Url $url */
if ($this->getDepth() > 0) {
$url->setAnchor($this->encodeAnchor($section->getId()));
}
$urlAttributes = array('data-base-target' => '_next', 'title' => $section->getId() === $section->getChapter()->getId() ? sprintf($view->translate('Show the chapter "%s"', 'toc.render.section.link'), $section->getChapter()->getTitle()) : sprintf($view->translate('Show the section "%s" of the chapter "%s"', 'toc.render.section.link'), $section->getTitle(), $section->getChapter()->getTitle()));
if ($section->getNoFollow()) {
$urlAttributes['rel'] = 'nofollow';
}
$this->content[] = '<li>' . $this->getView()->qlink($section->getTitle(), $url->getAbsoluteUrl(), null, $urlAttributes);
if (!$section->hasChildren()) {
$this->content[] = '</li>';
}
}
return implode("\n", $this->content);
}
示例6: getSummary
/**
* Get the problem data for the summary
*
* @return array|null
*/
public function getSummary()
{
if (!(bool) $this->isCurrentlyRunning()) {
return array('problems' => 1, 'title' => mt('monitoring', 'monitoring backend is not running'));
}
return null;
}
示例7: getReport
public function getReport()
{
if ($this->error === false) {
return array(sprintf(mt('monitoring', 'Command transport configuration has been successfully created: %s'), Config::resolvePath('modules/monitoring/commandtransports.ini')));
} elseif ($this->error !== null) {
return array(sprintf(mt('monitoring', 'Command transport configuration could not be written to: %s. An error occured:'), Config::resolvePath('modules/monitoring/commandtransports.ini')), sprintf(mt('setup', 'ERROR: %s'), IcingaException::describe($this->error)));
}
}
示例8: __construct
/**
* Create a new documentation parser for the given path
*
* @param string $path Path to the documentation
*
* @throws DocException If the documentation directory does not exist
* @throws NotReadableError If the documentation directory is not readable
*/
public function __construct($path)
{
if (!DirectoryIterator::isReadable($path)) {
throw new DocException(mt('doc', 'Documentation directory \'%s\' is not readable'), $path);
}
$this->path = $path;
$this->docIterator = new DirectoryIterator($path, 'md', DirectoryIterator::FILES_FIRST);
}
示例9: getReport
public function getReport()
{
if ($this->error === false) {
return array(sprintf(mt('monitoring', 'Monitoring instance configuration has been successfully created: %s'), Config::resolvePath('modules/monitoring/instances.ini')));
} elseif ($this->error !== null) {
return array(sprintf(mt('monitoring', 'Monitoring instance configuration could not be written to: %s. An error occured:'), Config::resolvePath('modules/monitoring/instances.ini')), sprintf(mt('setup', 'ERROR: %s'), $this->error->getMessage()));
}
}
示例10: getReport
public function getReport()
{
if ($this->error === false) {
$message = mt('setup', 'General configuration has been successfully written to: %s');
return '<p>' . sprintf($message, Config::resolvePath('config.ini')) . '</p>';
} elseif ($this->error !== null) {
$message = mt('setup', 'General configuration could not be written to: %s; An error occured:');
return '<p class="error">' . sprintf($message, Config::resolvePath('config.ini')) . '</p>' . '<p>' . $this->error->getMessage() . '</p>';
}
}
示例11: getReport
public function getReport()
{
if ($this->error === false) {
$message = mt('monitoring', 'Monitoring instance configuration has been successfully created: %s');
return '<p>' . sprintf($message, Config::resolvePath('modules/monitoring/instances.ini')) . '</p>';
} elseif ($this->error !== null) {
$message = mt('monitoring', 'Monitoring instance configuration could not be written to: %s; An error occured:');
return '<p class="error">' . sprintf($message, Config::resolvePath('modules/monitoring/instances.ini')) . '</p><p>' . $this->error->getMessage() . '</p>';
}
}
示例12: getActionsForService
public function getActionsForService(Service $service)
{
if ($service->check_command == "logstash_events") {
// TODO: add icon when Icingaweb2 supports it
// <i class="icon-doc-text"></i>
return array(mt('logstash', 'Logstash events') => Url::fromPath('elasticsearch/event/list', array('host' => $service->getHost()->getName(), 'service' => $service->getName())));
} else {
return array();
}
}
示例13: evaluate
protected function evaluate()
{
$moduleName = $this->getCondition();
if (Platform::extensionLoaded($moduleName)) {
$this->setStateText(sprintf(mt('setup', 'The PHP module %s is available.'), $this->getAlias() ?: $moduleName));
return true;
} else {
$this->setStateText(sprintf(mt('setup', 'The PHP module %s is missing.'), $this->getAlias() ?: $moduleName));
return false;
}
}
示例14: evaluate
protected function evaluate()
{
$classNameOrPath = $this->getCondition();
if (Platform::classExists($classNameOrPath)) {
$this->setStateText(sprintf(mt('setup', 'The %s is available.', 'setup.requirement.class'), $this->getAlias() ?: $classNameOrPath . ' ' . mt('setup', 'class', 'setup.requirement.class')));
return true;
} else {
$this->setStateText(sprintf(mt('setup', 'The %s is missing.', 'setup.requirement.class'), $this->getAlias() ?: $classNameOrPath . ' ' . mt('setup', 'class', 'setup.requirement.class')));
return false;
}
}
示例15: getBadgeTitle
protected function getBadgeTitle()
{
$translations = array('hosts_down_unhandled' => mt('monitoring', '%d unhandled hosts down'), 'services_critical_unhandled' => mt('monitoring', '%d unhandled services critical'));
$titles = array();
$sum = $this->summary();
foreach ($this->columns as $col) {
if (isset($sum->{$col}) && $sum->{$col} > 0) {
$titles[] = sprintf($translations[$col], $sum->{$col});
}
}
return implode(', ', $titles);
}