zerospam / laravel-gettext

Adds localization support to laravel applications using PoEdit and GNU-Gettext.
99 stars 56 forks source link

Locale reverts back to en_US, while locale has been changed #44

Open rutiger opened 4 years ago

rutiger commented 4 years ago

I am using Laravel 5.5.48 with nginx.

I have experienced this issue, all my configuration is correct following installation guide, I amb using gettext handler as stated in configuration.

'handler' => 'gettext',

For setting the locale I am using the expected function LaravelGettext::setLocale($locale) within a Middleware, which is loaded after start session. It sets locale correctly, and when I debug the Controller with LaravelGettext::getLocale() it returns the expected locale. However, it shows the page in _enUS

LaravelGettext::setLocale($locale); $gettextLocale = LaravelGettext::getLocale();

Above lines are used in my middleware, second line outputs the expected locale, but page still are not showing in the expected language, and everytime the show translations for _enUS locale.