Skip to content

Commit

Permalink
Merge pull request #224 from garygreen/master
Browse files Browse the repository at this point in the history
Fix changing locale after app has booted
  • Loading branch information
jenssegers committed Oct 6, 2016
2 parents e4d2b95 + f3fc573 commit ce421c3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/DateServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,19 @@ class DateServiceProvider extends ServiceProvider
* @return void
*/
public function boot()
{
$this->app['events']->listen('locale.changed', function () {
$this->setLocale();
});

$this->setLocale();
}

/**
* Set the locale.
*
*/
protected function setLocale()
{
$locale = $this->app['translator']->getLocale();

Expand Down

0 comments on commit ce421c3

Please sign in to comment.