stay on the same page after switching locale
Signed-off-by: ngn <ngn@ngn.tf>
This commit is contained in:
@@ -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>
|
||||||
|
@@ -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
|
||||||
|
Reference in New Issue
Block a user