Set the Current Application Locale


You want to change your application's locale.


Use the App::setLocale() method.

// Change to Spanish

Now the locale is es for the remainder of the request.

Remember: the next request the locale will be back to whatever the configuration specifies.


This does more than simply changing app.locale in the configuration.

It does three things:

  1. Changes app.locale in the currently loaded configuration values.
  2. Sets the locale of the translator.
  3. Fires a locale.changed event which your application can listen for.
comments powered by Disqus