fix bug of langauge chooser at setup

This commit is contained in:
printempw 2016-12-31 23:27:45 +08:00
parent 3b96166ee8
commit ad459653b4
2 changed files with 10 additions and 4 deletions

View File

@ -15,6 +15,15 @@ use App\Exceptions\PrettyPageException;
class SetupController extends Controller
{
public function __construct(Request $request)
{
if ($locale = $request->input('lang')) {
cookie()->queue('locale', $locale);
session(['locale' => $locale]);
app()->setLocale($locale);
}
}
public function welcome()
{
// already installed

View File

@ -20,10 +20,7 @@
var e = document.getElementById("language-chooser");
var lang = e.options[e.selectedIndex].value;
// set cookie
document.cookie = "locale=" + lang + "; path=/";
location.reload();
window.location = "?lang="+lang;
}
</script>