laravel-doctrine / extensions

Extensions integration for Doctrine2 and Laravel
http://laraveldoctrine.org/
MIT License
48 stars 24 forks source link

Translatable Extension #31

Open jralph opened 7 years ago

jralph commented 7 years ago

The translatable extension listens for the locale.changed event, in newer versions of Laravel this is incorrect. This event is now a class. $this['events']->dispatch(new Events\LocaleUpdated($locale));

Can this be updated to look for that event instead?

patrickbrouwers commented 7 years ago

Feel free to PR it.

jralph commented 7 years ago

Will do given chance.

Also needs to update how it gets the default locale. If you use Laravels app()->setLocale($someLocale) sets the config locale. If you do this in a middleware, it is usually set before the extension is loaded, so the default locale becomes the requested locale, meaning translations are never run, as it thinks the requested is the default. It needs a way to determine the default database locale from somewhere that is not the app's locale.