stay on the same page after switching locale

Signed-off-by: ngn <ngn@ngn.tf>
This commit is contained in:
ngn
2025-07-24 17:18:00 +03:00
parent 8adbc9d354
commit cb5f5628a3
2 changed files with 2 additions and 2 deletions

View File

@@ -9,7 +9,7 @@
} }
</script> </script>
<form action="/" method="get" {onsubmit}> <form method="get" {onsubmit}>
<input type="hidden" name="l" value={$next.code} /> <input type="hidden" name="l" value={$next.code} />
<button type="submit">{$next.icon}</button> <button type="submit">{$next.icon}</button>
</form> </form>

View File

@@ -12,7 +12,7 @@ export async function load({ cookies, request, url }) {
if (locale) { if (locale) {
set_locale(cookies, locale); set_locale(cookies, locale);
return redirect(307, "/"); return redirect(307, url.pathname);
} }
// attempt get the preferred locale from cookies // attempt get the preferred locale from cookies