Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save locale information on NextJS middleware #1781

Closed
twistershark opened this issue Jan 27, 2025 · 0 comments · Fixed by #1792
Closed

Save locale information on NextJS middleware #1781

twistershark opened this issue Jan 27, 2025 · 0 comments · Fixed by #1792
Assignees

Comments

@twistershark
Copy link
Contributor

We want to create a new cookie called SWC_LOCALE which will represent the current locale of the pages the user is visiting.

Whenever a user visits a page, our middleware should check if SWC_LOCALE exists. If it doesn't exist, we create SWC_LOCALE with the corresponding locale. Whenever a user visits a page in a different locale compared to what is saved in the SWC_LOCALE, we update the cookie in our middleware since this information will be used as metadata in Mixpanel, Sentry and everywhere else needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant