2013-06-07 11:44:37 +02:00
|
|
|
<?php
|
2015-02-03 16:27:59 +01:00
|
|
|
/* Icinga Web 2 | (c) 2013-2015 Icinga Development Team | http://www.gnu.org/licenses/gpl-2.0.txt */
|
2013-06-07 11:44:37 +02:00
|
|
|
|
2014-08-27 15:51:49 +02:00
|
|
|
use Icinga\Util\Translator;
|
2014-01-29 16:25:08 +01:00
|
|
|
|
|
|
|
if (extension_loaded('gettext')) {
|
2014-09-16 15:19:23 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* (non-PHPDoc)
|
|
|
|
* @see Translator::translate() For the function documentation.
|
|
|
|
*/
|
|
|
|
function t($messageId, $context = null)
|
2013-06-07 11:44:37 +02:00
|
|
|
{
|
2014-09-16 15:19:23 +02:00
|
|
|
return Translator::translate($messageId, Translator::DEFAULT_DOMAIN, $context);
|
2013-06-07 11:44:37 +02:00
|
|
|
}
|
|
|
|
|
2014-09-16 15:19:23 +02:00
|
|
|
/**
|
|
|
|
* (non-PHPDoc)
|
|
|
|
* @see Translator::translate() For the function documentation.
|
|
|
|
*/
|
|
|
|
function mt($domain, $messageId, $context = null)
|
2013-06-07 11:44:37 +02:00
|
|
|
{
|
2014-09-16 15:19:23 +02:00
|
|
|
return Translator::translate($messageId, $domain, $context);
|
2013-06-07 11:44:37 +02:00
|
|
|
}
|
2014-09-15 14:11:42 +02:00
|
|
|
|
2014-09-16 15:19:23 +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
|
|
|
{
|
2014-09-16 15:19:23 +02:00
|
|
|
return Translator::translatePlural($messageId, $messageId2, $number, Translator::DEFAULT_DOMAIN, $context);
|
2014-09-15 14:11:42 +02:00
|
|
|
}
|
|
|
|
|
2014-09-16 15:19:23 +02:00
|
|
|
/**
|
|
|
|
* (non-PHPDoc)
|
|
|
|
* @see Translator::translatePlural() For the function documentation.
|
|
|
|
*/
|
|
|
|
function mtp($domain, $messageId, $messageId2, $number, $context = null)
|
2014-09-11 18:04:10 +02:00
|
|
|
{
|
2014-09-16 15:19:23 +02:00
|
|
|
return Translator::translatePlural($messageId, $messageId2, $number, $domain, $context);
|
2014-09-11 18:04:10 +02:00
|
|
|
}
|
2014-09-16 15:19:23 +02:00
|
|
|
|
2013-06-07 11:44:37 +02:00
|
|
|
} else {
|
2014-09-16 15:19:23 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* (non-PHPDoc)
|
|
|
|
* @see Translator::translate() For the function documentation.
|
|
|
|
*/
|
|
|
|
function t($messageId, $context = null)
|
2013-06-07 11:44:37 +02:00
|
|
|
{
|
|
|
|
return $messageId;
|
|
|
|
}
|
|
|
|
|
2014-09-16 15:19:23 +02:00
|
|
|
/**
|
|
|
|
* (non-PHPDoc)
|
|
|
|
* @see Translator::translate() For the function documentation.
|
|
|
|
*/
|
|
|
|
function mt($domain, $messageId, $context = null)
|
2013-06-07 11:44:37 +02:00
|
|
|
{
|
|
|
|
return $messageId;
|
|
|
|
}
|
2014-09-15 14:11:42 +02:00
|
|
|
|
2014-09-16 15:19:23 +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
|
|
|
{
|
2014-09-16 15:19:23 +02:00
|
|
|
if ((int) $number !== 1) {
|
2014-09-15 14:11:42 +02:00
|
|
|
return $messageId2;
|
|
|
|
}
|
|
|
|
return $messageId;
|
|
|
|
}
|
|
|
|
|
2014-09-16 15:19:23 +02:00
|
|
|
/**
|
|
|
|
* (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
|
|
|
{
|
2014-09-16 15:19:23 +02:00
|
|
|
if ((int) $number !== 1) {
|
2014-09-15 14:11:42 +02:00
|
|
|
return $messageId2;
|
|
|
|
}
|
|
|
|
return $messageId;
|
|
|
|
}
|
2014-09-16 15:19:23 +02:00
|
|
|
|
2013-06-07 11:44:37 +02:00
|
|
|
}
|