Skip to content

Commit

Permalink
Using the correct locale all the time
Browse files Browse the repository at this point in the history
  • Loading branch information
Dean151 committed Mar 31, 2023
1 parent 1a2e48f commit f3760b7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/Email/AbstractEmailFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use App\Entity\User;
use Symfony\Bridge\Twig\Mime\TemplatedEmail;
use Symfony\Component\DependencyInjection\Attribute\Autowire;
use Symfony\Component\Mime\Email;
use Symfony\Component\Mime\Message;
use Symfony\Contracts\Translation\TranslatorInterface;
use Twig\Environment;
Expand Down Expand Up @@ -68,6 +67,6 @@ protected function getLocale(): string
*/
protected function translate(string $id, array $context, string $domain = null, string $locale = null): string
{
return $this->translator->trans($id, $context, $domain, $locale);
return $this->translator->trans($id, $context, $domain, $locale ?? $this->getLocale());
}
}

0 comments on commit f3760b7

Please sign in to comment.