Closed pa-ra-kram closed 3 years ago
Hi @pa-ra-krum !
This package is bound to the current request, so in a scheduled/queued job it will have no effect. You should do your own business logic to acomplish that, like:
1 - Pass the current locale to the Job 2 - Save the current locale on users table when he enters on the website
Laravel loads default language in job queues. It is probably because the queues are processed independently of the app language.
I was trying to send emails via queues, and it was always sending emails in English, regardless of the user's language.
To handle this, the language needs to be explicitly passed to the job.
Solution:
In the job file
Receive the payload array as usual, and set the locale manually.