diff --git a/module/VuFind/src/VuFind/View/Helper/Root/DisplayLanguageOption.php b/module/VuFind/src/VuFind/View/Helper/Root/DisplayLanguageOption.php index adea7d7d75fcbbdd3f6c9d76d038817e9b0d0980..2d80c55d084d1d8fae93ae7181c51d8a0634b85f 100644 --- a/module/VuFind/src/VuFind/View/Helper/Root/DisplayLanguageOption.php +++ b/module/VuFind/src/VuFind/View/Helper/Root/DisplayLanguageOption.php @@ -53,9 +53,7 @@ class DisplayLanguageOption extends \Zend\View\Helper\AbstractHelper */ public function __construct(TranslatorInterface $translator) { - // Clone the translator; we need to switch language for the purposes - // of this plugin, but we don't want that change to happen globally. - $this->translator = clone($translator); + $this->translator = $translator; try { $this->translator->addTranslationFile( 'ExtendedIni', diff --git a/module/VuFind/src/VuFind/View/Helper/Root/Factory.php b/module/VuFind/src/VuFind/View/Helper/Root/Factory.php index 3cb5f15bf5f637197bb2a0253ac2f1f211dcec12..9f59e62c02a5f887e9e44fbb4efc506e4e077414 100644 --- a/module/VuFind/src/VuFind/View/Helper/Root/Factory.php +++ b/module/VuFind/src/VuFind/View/Helper/Root/Factory.php @@ -139,8 +139,11 @@ class Factory */ public static function getDisplayLanguageOption(ServiceManager $sm) { + // We want to construct a separate translator instance for this helper, + // since it configures different language/locale than the core shared + // instance! return new DisplayLanguageOption( - $sm->getServiceLocator()->get('VuFind\Translator') + \VuFind\Service\Factory::getTranslator($sm->getServiceLocator()) ); }