joedixon / laravel-translation

Translation management for your Laravel application.
MIT License
694 stars 230 forks source link

app locale variable issue fixed in Translation Driver #285

Open OoBook opened 11 months ago

OoBook commented 11 months ago

I have faced out an issue on translation driver about your $sourceLanguage property, this variable has set on binding Translation::class, so when app::locale variable changes, $sourceLanguage keeps same. Thus, I propose that you can use one of app()->getLocale() or App::getLocale(), because I change this app locale variable on a middleware. Your translation view (translation/languages/translations/index.blade.php) occurs an error because of changing app->locale. At now, sourceLanguage property has assigned in vain. You can remove this assignments after checking it out.