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
|
||||
{
|
||||
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
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user