🐛 Fix change language not working in the editor
This commit is contained in:
@ -51,7 +51,14 @@ export const UserPreferencesForm = () => {
|
|||||||
|
|
||||||
const updateLocale = (locale: keyof typeof localeHumanReadable) => () => {
|
const updateLocale = (locale: keyof typeof localeHumanReadable) => () => {
|
||||||
document.cookie = `NEXT_LOCALE=${locale}; path=/; max-age=31536000`
|
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()
|
const currentLanguage = getLanguage()
|
||||||
|
Reference in New Issue
Block a user