From 8137f1546fc0aeaccb9fc33101eaba0239ba8e17 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 20 May 2021 09:11:21 +0200 Subject: [PATCH] Module: Register locales using ipl-i18n --- library/Icinga/Application/Modules/Module.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/library/Icinga/Application/Modules/Module.php b/library/Icinga/Application/Modules/Module.php index 6f4003622..7699c76bd 100644 --- a/library/Icinga/Application/Modules/Module.php +++ b/library/Icinga/Application/Modules/Module.php @@ -13,9 +13,10 @@ use Icinga\Exception\IcingaException; use Icinga\Exception\ProgrammingError; use Icinga\Module\Setup\SetupWizard; use Icinga\Util\File; -use Icinga\Util\Translator; use Icinga\Web\Navigation\Navigation; use Icinga\Web\Widget; +use ipl\I18n\GettextTranslator; +use ipl\I18n\StaticTranslator; use RecursiveDirectoryIterator; use RecursiveIteratorIterator; use Zend_Controller_Router_Route; @@ -1418,9 +1419,10 @@ class Module */ protected function registerLocales() { - if ($this->hasLocales()) { - Translator::registerDomain($this->name, $this->localedir); + if ($this->hasLocales() && StaticTranslator::$instance instanceof GettextTranslator) { + StaticTranslator::$instance->addTranslationDirectory($this->localedir, $this->name); } + return $this; }