Skip to content

Commit

Permalink
Fixed missing locale stamp when locale is manually given (#358)
Browse files Browse the repository at this point in the history
  • Loading branch information
aschempp authored Sep 5, 2024
1 parent 56a7547 commit 6385e34
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/NotificationCenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -363,9 +363,11 @@ public function createBasicStampsForNotification(int $id, TokenCollection|array
$stamps = new StampCollection([new NotificationConfigStamp($notificationConfig)]);

if (null === $locale && ($request = $this->requestStack->getCurrentRequest()) instanceof Request) {
$stamps = $stamps
->with(new LocaleStamp(LocaleUtil::formatAsLocale($request->getLocale())))
;
$locale = $request->getLocale();
}

if ($locale) {
$stamps = $stamps->with(new LocaleStamp(LocaleUtil::formatAsLocale($locale)));
}

if (!$tokens instanceof TokenCollection) {
Expand Down

0 comments on commit 6385e34

Please sign in to comment.