Setting the Default Locale


You want to change the default locale.


Use the Lang::setLocale() method.

Lang::setLocale('es'); // switch to Spanish


Difference between App::setLocale() and Lang::setLocale().

Lang::setLocale() only changes the locale in the currently loaded translation service.

App::setLocale() changes the currently loaded configuration value and calls Lang::setLocale() to update the translation service. Also, App::setLocale() fires a locale.changed event.

comments powered by Disqus