Commit 5939914c authored by catch's avatar catch
Browse files

Issue #3248809 by daffie, larowlan: [Symfony 6] The...

Issue #3248809 by daffie, larowlan: [Symfony 6] The Drupal\Tests\file\Kernel\FileItemValidationTest fails with Symfony 5

(cherry picked from commit f4d355a2)
parent 71b89659
......@@ -33,9 +33,8 @@ public function trans($id, array $parameters = [], $domain = NULL, $locale = NUL
// Symfony violation messages may separate singular and plural versions
// with "|".
$ids = explode('|', $id);
if (count($ids) > 1) {
$number = $parameters['%count%'] ?? 1;
return \Drupal::translation()->formatPlural($number, $ids[0], $ids[1], $this->processParameters($parameters), $this->getOptions($domain, $locale));
if ((count($ids) > 1) && isset($parameters['%count%'])) {
return \Drupal::translation()->formatPlural($parameters['%count%'], $ids[0], $ids[1], $this->processParameters($parameters), $this->getOptions($domain, $locale));
}
return new TranslatableMarkup($id, $this->processParameters($parameters), $this->getOptions($domain, $locale));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment