Skip to content

Commit

Permalink
Changes for MM xliff
Browse files Browse the repository at this point in the history
  • Loading branch information
zonky2 committed Apr 18, 2024
1 parent 10c8132 commit 4a034c4
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/Contao/View/Contao2BackendView/ButtonRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
use function is_string;
use function ltrim;
use function sprintf;
use function str_replace;
use function strlen;
use function strrpos;
use function substr_replace;
Expand Down Expand Up @@ -345,14 +346,23 @@ private function buildCommand($command, $model, $previous, $next, $isCircularRef
}
}

$definitionName = $this->environment->getDataDefinition()?->getName();
assert(is_string($definitionName));

$buttonEvent = new GetOperationButtonEvent($this->environment);
$buttonEvent
->setKey($command->getName())
->setCommand($command)
->setObjModel($model)
->setAttributes($attributes)
->setLabel($this->getCommandLabel($command))
->setTitle(sprintf($this->translate($command->getDescription()), $model->getID()))
->setTitle(
$this->translateButtonDescription(
str_replace('.description', '', $command->getDescription()),
$definitionName,
['%id%' => $model->getId()]
)
)
->setHref($this->calculateHref($command, $model))
->setChildRecordIds($childIds)
->setCircularReference($isCircularReference)
Expand Down

0 comments on commit 4a034c4

Please sign in to comment.