The TranslatableListener is storing the current locale when the extension is subscribed, and that's usually on ServiceProvider::register or boot. If the application changes its locale somewhere along the road (maybe middleware, or even in a late SP), the extension won't detect that change.
This PR hooks to Laravel's "locale.changed" event to update the listener with the new locale setting.
The TranslatableListener is storing the current locale when the extension is subscribed, and that's usually on ServiceProvider::register or boot. If the application changes its locale somewhere along the road (maybe middleware, or even in a late SP), the extension won't detect that change.
This PR hooks to Laravel's
"locale.changed"
event to update the listener with the new locale setting.