header('accept-language'); if ($language) { preg_match('/^([A-Za-z-]+),?/', $language, $matches); \App::setLocale($matches ? $matches[1] : 'zh-CN'); } return $next($request); } }