returns an array if there are multiple to be able to handle plural forms
This commit is contained in:
parent
1554e4ba7f
commit
4af83a6e39
1 changed files with 9 additions and 1 deletions
|
@ -157,7 +157,15 @@ class TranslationRequestMiddleware implements MiddlewareInterface
|
||||||
\ARRAY_FILTER_USE_KEY
|
\ARRAY_FILTER_USE_KEY
|
||||||
);
|
);
|
||||||
$result[$package] += \array_map(
|
$result[$package] += \array_map(
|
||||||
static fn($value) => $value[0]['target'],
|
static function ($value) {
|
||||||
|
if (\count($value) === 1) {
|
||||||
|
return $value[0]['target'];
|
||||||
|
}
|
||||||
|
return \array_map(
|
||||||
|
static fn ($value) => $value['target'],
|
||||||
|
$value
|
||||||
|
);
|
||||||
|
},
|
||||||
$matchingUnits
|
$matchingUnits
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue