public function injectTranslator($helper)
    {
        if (!$helper instanceof TranslatorAwareInterface) {
            return;
        }

        $locator = $this->getServiceLocator();

        if (!$locator) {
            return;
        }

        if ($locator->has('MvcTranslator')) {
            $helper->setTranslator($locator->get('MvcTranslator'));
            return;
        }

        if ($locator->has(TranslatorInterface::class)) {
            $helper->setTranslator($locator->get(TranslatorInterface::class));
            return;
        }

        if ($locator->has('Translator')) {
            $helper->setTranslator($locator->get('Translator'));
            return;
        }
    }
public function injectTranslator($helper)
    {
        if (!$helper instanceof TranslatorAwareInterface) {
            return;
        }

        $locator = $this->getServiceLocator();

        if (!$locator) {
            return;
        }

        if ($locator->has('MvcTranslator')) {
            $helper->setTranslator($locator->get('MvcTranslator'));
            return;
        }

        if ($locator->has(TranslatorInterface::class)) {
            $helper->setTranslator($locator->get(TranslatorInterface::class));
            return;
        }

        if ($locator->has('Translator')) {
            $helper->setTranslator($locator->get('Translator'));
            return;
        }
    }
public function injectTranslator ( $ helper ) { if ( ! $ helper instanceof TranslatorAwareInterface ) { return ; } $ locator = $ this -> getServiceLocator ( ) ; if ( ! $ locator ) { return ; } if ( $ locator -> has ( 'MvcTranslator' ) ) { $ helper -> setTranslator ( $ locator -> get ( 'MvcTranslator' ) ) ; return ; } if ( $ locator -> has ( TranslatorInterface :: class ) ) { $ helper -> setTranslator ( $ locator -> get ( TranslatorInterface :: class ) ) ; return ; } if ( $ locator -> has ( 'Translator' ) ) { $ helper -> setTranslator ( $ locator -> get ( 'Translator' ) ) ; return ; } }
Inject a helper instance with the registered translator

@param  Helper\HelperInterface $helper
@return void
Inject a helper instance with the registered translator