Hi, my objective is to inject the translator in a validator, but this is the error that is displayed:
Argument 1 passed to Zend\\Validator\\AbstractValidator::setDefaultTranslator() must be an instance of Zend\\Validator\\Translator\\TranslatorInterface or null, instance of Zend\\I18n\\Translator\\Translator given
After reading https://github.com/zendframework/zend-validator/issues/48 I found that I can’t use the class Zend\I18n\Translator\Translator to translate the validation messages. I don’t like the idea to use the Zend\Mvc dependency so I will create my specific bridge.
My bridge class:
use Zend\I18n\Translator\Translator;
use Zend\Validator\Translator\TranslatorInterface;
/**
* Bridge class to use the Zend\I18n\Translator\Translator when translating the validation messages
*/
class ValidatorTranslator extends Translator implements TranslatorInterface{
}