2
0

🐛 Fix change language not working in the editor

This commit is contained in:
Baptiste Arnaud
2023-12-08 15:48:05 +00:00
parent 7fcc4fb748
commit 0b93c2b239

View File

@ -51,7 +51,14 @@ export const UserPreferencesForm = () => {
const updateLocale = (locale: keyof typeof localeHumanReadable) => () => {
document.cookie = `NEXT_LOCALE=${locale}; path=/; max-age=31536000`
router.replace(router.pathname, undefined, { locale })
router.replace(
{
pathname: router.pathname,
query: router.query,
},
undefined,
{ locale }
)
}
const currentLanguage = getLanguage()