You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.
The section "Using pre-translated validation messages" on the Zend Validator documentaion has the following example:
use Zend\I18n\Translator\Resources;
use Zend\Mvc\I18n\Translator;
use Zend\Validator\AbstractValidator;
$translator = new Zend\Mvc\I18n\Translator();
$translator->addTranslationFilePattern(
'phpArray',
Resources::getBasePath(),
Resources::getPatternForValidator()
);
AbstractValidator::setDefaultTranslator($translator);
Fist Zend\Mvc\I18n\Translator(); needs an I18nTranslatorInterface and that's not documented on this example.
The another problem with this example is that it throws this Exception:
A plugin by the name "phpArray" was not found in the plugin manager Zend\I18n\Translator\LoaderPluginManager
Because the alias for Zend\I18n\Translator\Loader\PhpArray now is "phparray" not "phpArray"
The text was updated successfully, but these errors were encountered:
I was going to report the same.
I can get past line 5 replacing it with: $translator = new Zend\Mvc\I18n\Translator(new Zend\I18n\Translator\Translator());
While this allows the example to run, it does not change the language. And indeed, the example never specifies German.
Yet another problem: the __call() function of Translator (surely used for addTranslationFilePattern()) is marked as deprecated.
The section "Using pre-translated validation messages" on the Zend Validator documentaion has the following example:
Fist Zend\Mvc\I18n\Translator(); needs an I18nTranslatorInterface and that's not documented on this example.
The another problem with this example is that it throws this Exception:
Because the alias for Zend\I18n\Translator\Loader\PhpArray now is "phparray" not "phpArray"
The text was updated successfully, but these errors were encountered: