Skip to content
Snippets Groups Projects
Commit 84ff6412 authored by Demian Katz's avatar Demian Katz Committed by André Lahmann
Browse files

Fixed bug: translation broken by displayLanguageOption helper.

- Resolves VUFIND-1111
parent 16be242c
No related merge requests found
......@@ -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',
......
......@@ -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())
);
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment