Fix locale detection

This commit is contained in:
Pig Fang 2019-10-07 19:37:38 +08:00
parent 55b9b5ad9e
commit c424465321

View File

@ -13,7 +13,7 @@ class DetectLanguagePrefer
if (($info = Arr::get(config('locales'), $locale)) && ($alias = Arr::get($info, 'alias'))) {
$locale = $alias;
}
app()->setLocale($locale);
app()->setLocale($locale ?? app()->getLocale());
Cookie::queue('locale', $locale);
return $next($request);