icingaweb2/library/Icinga/Application/functions.php

89 lines
2.2 KiB
PHP
Raw Normal View History

<?php
/* Icinga Web 2 | (c) 2013-2015 Icinga Development Team | http://www.gnu.org/licenses/gpl-2.0.txt */
use Icinga\Util\Translator;
if (extension_loaded('gettext')) {
/**
* (non-PHPDoc)
* @see Translator::translate() For the function documentation.
*/
function t($messageId, $context = null)
{
return Translator::translate($messageId, Translator::DEFAULT_DOMAIN, $context);
}
/**
* (non-PHPDoc)
* @see Translator::translate() For the function documentation.
*/
function mt($domain, $messageId, $context = null)
{
return Translator::translate($messageId, $domain, $context);
}
2014-09-15 14:11:42 +02:00
/**
* (non-PHPDoc)
* @see Translator::translatePlural() For the function documentation.
*/
function tp($messageId, $messageId2, $number, $context = null)
2014-09-15 14:11:42 +02:00
{
return Translator::translatePlural($messageId, $messageId2, $number, Translator::DEFAULT_DOMAIN, $context);
2014-09-15 14:11:42 +02:00
}
/**
* (non-PHPDoc)
* @see Translator::translatePlural() For the function documentation.
*/
function mtp($domain, $messageId, $messageId2, $number, $context = null)
{
return Translator::translatePlural($messageId, $messageId2, $number, $domain, $context);
}
} else {
/**
* (non-PHPDoc)
* @see Translator::translate() For the function documentation.
*/
function t($messageId, $context = null)
{
return $messageId;
}
/**
* (non-PHPDoc)
* @see Translator::translate() For the function documentation.
*/
function mt($domain, $messageId, $context = null)
{
return $messageId;
}
2014-09-15 14:11:42 +02:00
/**
* (non-PHPDoc)
* @see Translator::translatePlural() For the function documentation.
*/
function tp($messageId, $messageId2, $number, $context = null)
2014-09-15 14:11:42 +02:00
{
if ((int) $number !== 1) {
2014-09-15 14:11:42 +02:00
return $messageId2;
}
return $messageId;
}
/**
* (non-PHPDoc)
* @see Translator::translatePlural() For the function documentation.
*/
function mtp($domain, $messageId, $messageId2, $number, $context = null)
2014-09-15 14:11:42 +02:00
{
if ((int) $number !== 1) {
2014-09-15 14:11:42 +02:00
return $messageId2;
}
return $messageId;
}
}