From 124719ccf4be1bce2a43b588ffd0ee2ac81960e7 Mon Sep 17 00:00:00 2001 From: Tim van Dijen <tvdijen@gmail.com> Date: Wed, 23 Feb 2022 12:31:44 +0100 Subject: [PATCH] Fix incorrect use of gettext --- lib/SimpleSAML/Locale/Localization.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/SimpleSAML/Locale/Localization.php b/lib/SimpleSAML/Locale/Localization.php index 0f88de89f..b10a94012 100644 --- a/lib/SimpleSAML/Locale/Localization.php +++ b/lib/SimpleSAML/Locale/Localization.php @@ -11,6 +11,7 @@ declare(strict_types=1); namespace SimpleSAML\Locale; use Exception; +use Gettext\Generator\ArrayGenerator; use Gettext\Loader\PoLoader; use Gettext\Translations; use Gettext\Translator; @@ -250,8 +251,7 @@ class Localization $file = new File($langPath . $domain . '.po'); if ($this->fileSystem->exists($file->getRealPath()) && $file->isReadable()) { - $poLoader = new PoLoader(); - $translations = $poLoader->loadFile($file); + $translations = (new PoLoader())->loadFile($file); $arrayGenerator = new ArrayGenerator(); $this->translator->addTranslations( $arrayGenerator->generateArray($translations) -- GitLab