This repository has been archived by the owner on Jan 30, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 50
NotEmpty::IS_EMPTY not translated #71
Comments
The same problem. Any ideas? |
And how to set a custom message for required field? Message generate without any validators https://github.com/zendframework/zend-inputfilter/blob/master/src/Input.php#L407. |
As a temporary solution I rewrote the class method like this: protected function prepareRequiredValidationFailureMessage()
{
$notEmpty = new NotEmpty();
$templates = $notEmpty->getOption('messageTemplates');
$message = $notEmpty->hasTranslator()
? $notEmpty->getTranslator()->translate($templates[NotEmpty::IS_EMPTY])
: $templates[NotEmpty::IS_EMPTY];
return [
// TODO remove this file
// @issue message translation fix https://github.com/zendframework/zend-inputfilter/issues/71
NotEmpty::IS_EMPTY => $message,
];
} But I think it's even a more mess now. |
does this help? #73 |
In #73 message still get from templates, without translation.
|
you could set translated message with validator options, but yes this is not perfect. |
I think this is solved in |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
How is it possible to translate NotEmpty::IS_EMPTY message?
https://github.com/zendframework/zend-inputfilter/blob/master/src/Input.php#L497
The text was updated successfully, but these errors were encountered: