-
Notifications
You must be signed in to change notification settings - Fork 38
Persistent Locale #44
Copy link
Copy link
Closed
Labels
Description
Hi, i just install this package. But I'm a little confused.
I have config/app.php with:
'locale' => 'es',And config/localization.phpas:
'supported-locales' => ['en', 'es'],
'accept-language-header' => true,
'hide-default-in-url' => false,
'facade' => 'Localization',
/* ------------------------------------------------------------------------------------------------
| Route
| ------------------------------------------------------------------------------------------------
*/
'route' => [
'middleware' => [
'localization-session-redirect' => true,
'localization-cookie-redirect' => false,
'localization-redirect' => true,
'localized-routes' => true,
'translation-redirect' => true,
],
],I have and admin panel without routes translates. And In my views if I call dump(\App::getLocale()), allways get en neveres. But es is the default language. If I call dump(\App::getLocale()) in routes.php file shows es.
But If I call Localization::getCurrentLocale()shows correctly es.
My route is for example: blog/new. And Route is not in localization middleware:
Route::group(['prefix' => 'admin', 'middleware' => 'role:admin'], function()
{
Route::get('/blog/new', '\App\Blog\Controllers\PostController@create');
});Why locale is set to en? How can I do it?
Thanks!
Reactions are currently unavailable