From 7ee9ce66b51b30c1c21eadd0bfa78bc2f024a7b7 Mon Sep 17 00:00:00 2001 From: nanaya Date: Tue, 7 Jan 2025 20:10:36 +0900 Subject: [PATCH] Force browser page refresh on locale change --- app/Http/Controllers/HomeController.php | 2 +- resources/views/layout/ujs_full_reload.blade.php | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 resources/views/layout/ujs_full_reload.blade.php diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index 0cd6ff043d9..b1a1b491fd0 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -210,7 +210,7 @@ public function setLocale() ]); } - return ext_view('layout.ujs-reload', [], 'js') + return ext_view('layout.ujs_full_reload', [], 'js') ->withCookie(cookie()->forever('locale', $newLocale)); } diff --git a/resources/views/layout/ujs_full_reload.blade.php b/resources/views/layout/ujs_full_reload.blade.php new file mode 100644 index 00000000000..58a93c38b26 --- /dev/null +++ b/resources/views/layout/ujs_full_reload.blade.php @@ -0,0 +1,5 @@ +{{-- + Copyright (c) ppy Pty Ltd . Licensed under the GNU Affero General Public License v3.0. + See the LICENCE file in the repository root for full licence text. +--}} +window.location.reload();