ARCANEDEV / Localization

:globe_with_meridians: Localization package for Laravel
MIT License
187 stars 37 forks source link

Current language is not been saved in a session #147

Closed perffy closed 5 years ago

perffy commented 5 years ago

Description When I open my domain and change the language, if i open a new tab and enter again the domain, it does not redirect me to my last choice. I dont know if the problem is, that i am hiding the default language prefix.

Steps To Reproduce:

routes/frontend/home.php

Route::group([
    'prefix'     => Localization::setLocale(),
    'middleware' => [
        'localization-session-redirect',
        'localization-redirect',
    ],
], function() {

    Route::transGet('routes.predictions.index', 'HomeController@index')->name('index');
    Route::transGet('routes.predictions.show', 'HomeController@show')->name('show');

    Route::transGet('routes.standings.country', 'StandingController@country')->name('standings.country');
    Route::transGet('routes.standings.show', 'StandingController@show')->name('standings.show');
    Route::transGet('routes.standings.overall', 'StandingController@overall')->name('standings.overall');

});

localization.php

'supported-locales'      => ['en', 'de', 'bg'],

    'accept-language-header' => true,

    'hide-default-in-url'    => true,

    'redirection-code'       => 302,

    'facade'                 => 'Localization',

    'utf-8-suffix'           => '.UTF-8',

    'route'                  => [
        'middleware' => [
            'localization-session-redirect' => true,
            'localization-cookie-redirect'  => false,
            'localization-redirect'         => true,
            'localized-routes'              => true,
            'translation-redirect'          => true,
        ],
    ],
arcanedev-maroc commented 5 years ago

Check this previous issue: https://github.com/ARCANEDEV/Localization/issues/107