From 010618d0108aecd489ce6bf7e771982a1fe94106 Mon Sep 17 00:00:00 2001 From: Tim van Dijen <tvdijen@gmail.com> Date: Sun, 20 Feb 2022 01:42:48 +0100 Subject: [PATCH] Fix --- lib/SimpleSAML/Locale/Translate.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/SimpleSAML/Locale/Translate.php b/lib/SimpleSAML/Locale/Translate.php index 375c458b8..1982c6b45 100644 --- a/lib/SimpleSAML/Locale/Translate.php +++ b/lib/SimpleSAML/Locale/Translate.php @@ -81,7 +81,8 @@ class Translate // This may happen if you forget to set a variable and then run undefinedVar through the trans-filter $original = $original ?? 'undefined variable'; - $text = Translator::$current->gettext($original); + $loc = new Localization(Configuration::getInstance()); + $text = $loc->getTranslator()->gettext($original); if (func_num_args() === 1) { return $text; @@ -107,7 +108,8 @@ class Translate // This may happen if you forget to set a variable and then run undefinedVar through the trans-filter $original = $original ?? 'undefined variable'; - $text = Translator::$current->ngettext($original, $plural, $value); + $loc = new Localization(Configuration::getInstance()); + $text = $loc->getTranslator()->ngettext($original, $plural, $value); if (func_num_args() === 3) { return $text; -- GitLab