2013-06-07 11:44:37 +02:00
|
|
|
<?php
|
2013-10-23 15:10:33 +02:00
|
|
|
// {{{ICINGA_LICENSE_HEADER}}}
|
|
|
|
// {{{ICINGA_LICENSE_HEADER}}}
|
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')) {
|
|
|
|
function t($messageId)
|
2013-06-07 11:44:37 +02:00
|
|
|
{
|
2014-06-11 13:39:22 +02:00
|
|
|
return Translator::translate($messageId, Translator::DEFAULT_DOMAIN);
|
2013-06-07 11:44:37 +02:00
|
|
|
}
|
|
|
|
|
2014-01-29 16:25:08 +01:00
|
|
|
function mt($domain, $messageId)
|
2013-06-07 11:44:37 +02:00
|
|
|
{
|
2014-01-29 16:25:08 +01:00
|
|
|
return Translator::translate($messageId, $domain);
|
2013-06-07 11:44:37 +02:00
|
|
|
}
|
2014-09-15 14:11:42 +02:00
|
|
|
|
|
|
|
function tp($messageId, $messageId2, $number)
|
|
|
|
{
|
|
|
|
return Translator::translatePlural($messageId, $messageId2, $number, Translator::DEFAULT_DOMAIN);
|
|
|
|
}
|
|
|
|
|
|
|
|
function mtp($domain, $messageId, $messageId2, $number)
|
2014-09-11 18:04:10 +02:00
|
|
|
{
|
2014-09-15 14:11:42 +02:00
|
|
|
return Translator::translatePlural($messageId, $messageId2, $number, $domain);
|
2014-09-11 18:04:10 +02:00
|
|
|
}
|
2013-06-07 11:44:37 +02:00
|
|
|
} else {
|
2014-01-29 16:25:08 +01:00
|
|
|
function t($messageId)
|
2013-06-07 11:44:37 +02:00
|
|
|
{
|
|
|
|
return $messageId;
|
|
|
|
}
|
|
|
|
|
2014-01-29 16:25:08 +01:00
|
|
|
function mt($domain, $messageId)
|
2013-06-07 11:44:37 +02:00
|
|
|
{
|
|
|
|
return $messageId;
|
|
|
|
}
|
2014-09-15 14:11:42 +02:00
|
|
|
|
|
|
|
function tp($messageId, $messageId2, $number)
|
|
|
|
{
|
|
|
|
if ($number === 0 || $number > 1 || $number < 0) {
|
|
|
|
return $messageId2;
|
|
|
|
}
|
|
|
|
return $messageId;
|
|
|
|
}
|
|
|
|
|
|
|
|
function mt($domain, $messageId, $messageId2, $number)
|
|
|
|
{
|
|
|
|
if ($number === 0 || $number > 1 || $number < 0) {
|
|
|
|
return $messageId2;
|
|
|
|
}
|
|
|
|
return $messageId;
|
|
|
|
}
|
2013-06-07 11:44:37 +02:00
|
|
|
}
|