Pre-select the users language on setup

This commit is contained in:
James Brooks
2015-11-21 13:49:14 +00:00
parent bcd7763f84
commit d08283f8a5
2 changed files with 14 additions and 1 deletions

View File

@@ -62,9 +62,22 @@ class SetupController extends Controller
$this->keyGenerate();
}
$supportedLanguages = Request::getLanguages();
$userLanguage = Config::get('app.locale');
foreach ($supportedLanguages as $language) {
$language = str_replace('_', '-', $language);
if (isset($this->langs[$language])) {
$userLanguage = $language;
break;
}
}
return View::make('setup')
->withPageTitle(trans('setup.setup'))
->withCacheDrivers($this->cacheDrivers)
->withUserLanguage($userLanguage)
->withAppUrl(Request::root());
}