Hi,

In changelog.md :
https://github.com/zendframework/zf2/blob/master/CHANGELOG.md
<https://github.com/zendframework/zf2/blob/master/CHANGELOG.md#potential-breakage>Potential
Breakage

Zend\Validator was altered to remove the dependency on Zend\I18n by
creating Segregated
Interfaces<http://en.wikipedia.org/wiki/Interface_segregation_principle>.
The practical upshot is that Zend\Validator\AbstractValidator no longer
implements Zend\I18n\Translator\TranslatorAwareInterface, but rather
Zend\Validator\Translator\TranslatorAwareInterface, which now typehints on
Zend\Validator\Translator\TranslatorInterface instead of
Zend\I18n\Translator\Translator. This means you cannot pass a
Zend\I18n\Translator\Translator instance directly to a validator any longer.

However, we have included a new class, Zend\Mvc\I18n\Translator, that
extends the i18n Translator class and implements the Validator
TranslatorInterface. This class may be used as a drop-in replacement. In
fact, by default, Zend\Validator\ValidatorPluginManager is now using the
MvcTranslator service, which utilizes this new class, making the change
seamless for most users.

The above change will only affect you if you were manually injecting a
translator instance into your validators.


So you may be able to do :

\Zend\Validator\AbstractValidator::setDefaultTranslator(new
\Zend\Mvc\I18n\Translator($translator));



2013/5/17 Ross <basarev...@gmail.com>

> Here is the example I was using:
>
>
> http://framework.zend.com/manual/2.0/en/modules/zend.validator.messages.html#using-pre-translated-validation-messages
>
> But with the recent ZF version I get:
>
> Catchable fatal error: Argument 1 passed to
> Zend\Validator\AbstractValidator::setDefaultTranslator() must be an
> instance of Zend\Validator\Translator\TranslatorInterface, instance of
> Zend\I18n\Translator\Translator given
>
> --
> List: fw-general@lists.zend.com
> Info: http://framework.zend.com/archives
> Unsubscribe: fw-general-unsubscr...@lists.zend.com
>
>
>


-- 
Pierre Rambaud
Website: http://pierrerambaud.com <http://rambaudpierre.fr>
G+: https://plus.google.com/u/0/107809758756474139920/posts
Github: https://github.com/PierreRambaud

Reply via email to