Use $app['translator']->getLocale(); instead of $app['locale']

If you change the locale value in a 'before' middleware:

$app['translator']->setLocale('es');

The $app['locale'] is not updated and the locale keeps the old value.

Using $app['translator']->getLocale() fixes the issue.