From 0b93c2b2390a3b19f6466ba70d737c0e45a97eba Mon Sep 17 00:00:00 2001 From: Baptiste Arnaud Date: Fri, 8 Dec 2023 15:48:05 +0000 Subject: [PATCH] :bug: Fix change language not working in the editor --- .../features/account/components/UserPreferencesForm.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/builder/src/features/account/components/UserPreferencesForm.tsx b/apps/builder/src/features/account/components/UserPreferencesForm.tsx index 2515cac94..e2d2d9aa2 100644 --- a/apps/builder/src/features/account/components/UserPreferencesForm.tsx +++ b/apps/builder/src/features/account/components/UserPreferencesForm.tsx @@ -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()