fix bug of langauge chooser at setup
This commit is contained in:
parent
3b96166ee8
commit
ad459653b4
|
|
@ -15,6 +15,15 @@ use App\Exceptions\PrettyPageException;
|
||||||
|
|
||||||
class SetupController extends Controller
|
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()
|
public function welcome()
|
||||||
{
|
{
|
||||||
// already installed
|
// already installed
|
||||||
|
|
|
||||||
|
|
@ -20,10 +20,7 @@
|
||||||
var e = document.getElementById("language-chooser");
|
var e = document.getElementById("language-chooser");
|
||||||
var lang = e.options[e.selectedIndex].value;
|
var lang = e.options[e.selectedIndex].value;
|
||||||
|
|
||||||
// set cookie
|
window.location = "?lang="+lang;
|
||||||
document.cookie = "locale=" + lang + "; path=/";
|
|
||||||
|
|
||||||
location.reload();
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user