Waavi / translation

Better translation management for Laravel
MIT License
359 stars 167 forks source link

Incorrect set defaultLocale in registerLoader() #145

Open 1dnmr opened 5 years ago

1dnmr commented 5 years ago

Hi,

This code incorrect:

protected function registerLoader()
{
...
            $defaultLocale = $app['config']->get('app.locale');
            $loader        = null;
            $source        = $app['config']->get('translator.source');
...
}

Should be replaced with :

            $defaultLocale = config('app.locale');
            $loader        = null;
            $source        = config('translator.source');

When I set locale to my App $app['config'] return what I set and this is not a default locale. Current code lead to a bugs when I use __() and send locale as parameter it's does not work properly.

Or add me as collaborator, a make changes and send pull request.