functions.php: failsafe method initialization

This avoids collisions for modules not using the fake bootstrap in our
current tests. Can be removed once we fixed that.
This commit is contained in:
Thomas Gelf 2016-02-25 18:07:29 +01:00
parent 1bbb7a3118
commit 9231746d09
1 changed files with 5 additions and 1 deletions

View File

@ -3,7 +3,6 @@
use Icinga\Util\Translator; use Icinga\Util\Translator;
/** /**
* No-op translate * No-op translate
* *
@ -19,6 +18,11 @@ function N_($messageId)
return $messageId; return $messageId;
} }
// Workaround for test issues, this is required unless our tests are able to
// accomplish "real" bootstrapping
if (function_exists('t')) {
return;
}
if (extension_loaded('gettext')) { if (extension_loaded('gettext')) {