Skip to content

Commit

Permalink
[11.x] Revert "[9.x] Translation of the default message of the valida…
Browse files Browse the repository at this point in the history
…tor" (#46378)

* [9.x] Update CHANGELOG.md

* Update facade docblocks

* [9.x] Update CHANGELOG.md

* Revert "[9.x] Translation of the default message of the validator (#43837)"

This reverts commit a833a88.

---------

Co-authored-by: Tetiana Blindaruk <t.blindaruk@gmail.com>
Co-authored-by: TBlindaruk <TBlindaruk@users.noreply.github.com>
  • Loading branch information
3 people authored Mar 13, 2023
1 parent 5c8b33f commit 68caccf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Illuminate/Validation/ValidationException.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,15 @@ protected static function summarize($validator)
$messages = $validator->errors()->all();

if (! count($messages) || ! is_string($messages[0])) {
return $validator->getTranslator()->get('The given data was invalid.');
return 'The given data was invalid.';
}

$message = array_shift($messages);

if ($count = count($messages)) {
$pluralized = $count === 1 ? 'error' : 'errors';
if ($additional = count($messages)) {
$pluralized = $additional === 1 ? 'error' : 'errors';

$message .= ' '.$validator->getTranslator()->get("(and :count more $pluralized)", compact('count'));
$message .= " (and {$additional} more {$pluralized})";
}

return $message;
Expand Down

0 comments on commit 68caccf

Please sign in to comment.