Skip to content

Commit ce421c3

Browse files
authored
Merge pull request jenssegers#224 from garygreen/master
Fix changing locale after app has booted
2 parents e4d2b95 + f3fc573 commit ce421c3

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

src/DateServiceProvider.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,19 @@ class DateServiceProvider extends ServiceProvider
1717
* @return void
1818
*/
1919
public function boot()
20+
{
21+
$this->app['events']->listen('locale.changed', function () {
22+
$this->setLocale();
23+
});
24+
25+
$this->setLocale();
26+
}
27+
28+
/**
29+
* Set the locale.
30+
*
31+
*/
32+
protected function setLocale()
2033
{
2134
$locale = $this->app['translator']->getLocale();
2235

0 commit comments

Comments
 (0)