Skip to content

Commit 6bf5526

Browse files
committed
Apply suggestions from code review.
1 parent bb48db7 commit 6bf5526

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/Component/src/Symfony/Session/Flash/FlashHelper.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,10 @@ private function buildOperationMessage(Operation $operation, string $type): stri
7979
$resource = $operation->getResource();
8080
Assert::notNull($resource);
8181

82-
$keySuffix = 'error' === $type ? '_error' : '';
83-
82+
$translationKeySuffix = sprintf('%s%s', $operation->getShortName() ?? '', 'error' === $type ? '_error' : '');
8483
$key = 'success' === $type ? $operation->getNotificationMessage() : null;
85-
$key ??= sprintf('%s.%s.%s', $resource->getApplicationName() ?? '', $resource->getName() ?? '', ($operation->getShortName() ?? '') . $keySuffix);
86-
87-
$fallbackKey = sprintf('sylius.resource.%s', ($operation->getShortName() ?? '') . $keySuffix);
84+
$key ??= sprintf('%s.%s.%s', $resource->getApplicationName() ?? '', $resource->getName() ?? '', $translationKeySuffix);
85+
$fallbackKey = sprintf('sylius.resource.%s', $translationKeySuffix);
8886

8987
$parameters = $this->getTranslationParameters($operation);
9088

0 commit comments

Comments
 (0)