Skip to content

Commit

Permalink
Preserve window.location.search
Browse files Browse the repository at this point in the history
  • Loading branch information
starsep committed May 9, 2024
1 parent 44f4f6e commit 00dd1e7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ i18n

i18n.on("languageChanged", (lang: string) => {
document.documentElement.setAttribute("lang", lang);
const urlWithLang = `${window.location.origin}/${lang}/${window.location.hash}`;
const urlWithLang = `${window.location.origin}/${lang}/${window.location.search}${window.location.hash}`;
window.history.pushState({}, "", urlWithLang);
});

Expand Down

0 comments on commit 00dd1e7

Please sign in to comment.