This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Just like getLocale
, why isn't there a setLocale
?
#1381
Labels
You can continue the conversation there. Go to discussion →
getLocale
, why isn't there a setLocale
?
#1381
Is your feature request related to a problem? Please describe.
I tried using App Router setup without i18n routing and defined a local switcher following official example.
This solution worked fine in the local development environment but resulted in an error (Cookies can only be modified in a Server Action or Route Handler.
nextjs 14.2.13
) in the production environment on Vercel."Describe the solution you'd like
I think
next-intl
should have a direct utility to set the locale from both client and server components. Just as we can access the current locale usinggetLocale
in server oruseLocale
in client, there should be a similar feature for setting the locale.NOTE: If I'm missing something or if such solutions already exist, please point me to the direct solution.
Describe alternatives you've considered
Alternative solutions might vary from developer to developer. I am working on a way to address this, but it would be better if there were an official solution.
The text was updated successfully, but these errors were encountered: