Skip to content

Commit

Permalink
Fix translation of property
Browse files Browse the repository at this point in the history
  • Loading branch information
zonky2 committed Sep 23, 2024
1 parent 577a382 commit fd35d71
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -235,12 +235,18 @@ private function isPropertyAllowed(PropertyInterface $property, EnvironmentInter
$inputProvider = $environment->getInputProvider();
assert($inputProvider instanceof InputProviderInterface);

$definition = $environment->getDataDefinition();
assert($definition instanceof ContainerInterface);

$modelName = $definition->getBasicDefinition()->getDataProvider();

Message::addInfo(
$translator->translate(
'not_allowed_property_info',
'dc-general',
[
'%property%' => $property->getLabel() ?: $property->getName(),
'%property%' => $translator->translate($property->getLabel(), $modelName)
?: $property->getName(),
'%mode%' => $translator->translate(
$inputProvider->getParameter('mode') . 'Selected',
'dc-general'
Expand Down

0 comments on commit fd35d71

Please sign in to comment.