On Mar 11, 2014 4:08 PM, "Ralf Eggert" <r.egg...@travello.de> wrote:
> Matthew Weier O'Phinney schrieb am 11.03.2014 18:45:
> > This is now addressed -- Norbert and Ralf -- can you each test again
for me? :)
>
> I get this message:
>
>   Fatal error: Call to undefined method Zend\Mvc
>   \I18n\Translator::factory() in /home/devhost/v3.travello.com/vendor
>   /RalfEggert/travello-library/src/TravelloLib/Mvc/Router
>   /TranslatorFactory.php on line 39
>
> for this code
>
>   use Zend\Mvc\I18n\Translator;
>
>   $translator = Translator::factory($config['router']['translator']);
>
> Zend\Mvc\I18n\Translator used to extend Zend\I18n\Translator\Translator
> in 2.2.x and now it implements Zend\I18n\Translator\TranslatorInterface
> and does not implement a factory method any more.
>
> I solved this issue like this:
>
>   use Zend\I18n\Translator\Translator as I18nTranslator;
>   use Zend\Mvc\I18n\Translator as MvcTranslator;
>
>   $translator = new MvcTranslator(
>     I18nTranslator::factory($config['router']['translator'])
>   );

That's a good point, and I'll make sure to point it out in the release
notes. The MvcTranslator is generally only expected to be pulled from the
ServiceManager, and rarely instantiated directly, which is why we made the
change. However, that assumption is clearly not entirely true, so we'll
need to call out the change in constructor for use cases like yours.

Reply via email to