You've already forked Epicnabbo-Catalogus-Updated-Daily
Update LocalizationMiddleware.php
This commit is contained in:
@@ -16,9 +16,11 @@ class LocalizationMiddleware
|
||||
{
|
||||
// Controleer of de instellingen bestaan en of de taal al in de sessie staat
|
||||
if (Schema::hasTable('website_settings') && Session::has('locale')) {
|
||||
App::setLocale(Session::get('locale'));
|
||||
App::setLocale((string) Session::get('locale'));
|
||||
|
||||
return $next($request);
|
||||
$response = $next($request);
|
||||
assert($response instanceof Response);
|
||||
return $response;
|
||||
}
|
||||
|
||||
$countryCode = config('habbo.site.default_language');
|
||||
@@ -38,13 +40,17 @@ class LocalizationMiddleware
|
||||
App::setLocale($defaultCountry);
|
||||
Session::put('locale', $defaultCountry);
|
||||
|
||||
return $next($request);
|
||||
$response = $next($request);
|
||||
assert($response instanceof Response);
|
||||
return $response;
|
||||
}
|
||||
|
||||
// Zet de gedetecteerde taal
|
||||
App::setLocale($countryCode);
|
||||
Session::put('locale', $countryCode);
|
||||
|
||||
return $next($request);
|
||||
$response = $next($request);
|
||||
assert($response instanceof Response);
|
||||
return $response;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user