icingaweb2/library/Icinga/Application/functions.php

54 lines
1.2 KiB
PHP
Raw Normal View History

<?php
2013-10-23 15:10:33 +02:00
// {{{ICINGA_LICENSE_HEADER}}}
// {{{ICINGA_LICENSE_HEADER}}}
use Icinga\Util\Translator;
if (extension_loaded('gettext')) {
function t($messageId)
{
return Translator::translate($messageId, Translator::DEFAULT_DOMAIN);
}
function mt($domain, $messageId)
{
return Translator::translate($messageId, $domain);
}
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-15 14:11:42 +02:00
return Translator::translatePlural($messageId, $messageId2, $number, $domain);
}
} else {
function t($messageId)
{
return $messageId;
}
function mt($domain, $messageId)
{
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;
}
}