server('HTTP_ACCEPT_LANGUAGE'), 0, 2); if (!in_array($locale, json_decode(Settings::getValueByKey("SETTINGS::LOCALE:AVAILABLE")))) { $locale = Settings::getValueByKey("SETTINGS::LOCALE:DEFAULT"); } } } App::setLocale($locale); return $next($request); } }