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

[Docs]: Example for app directory + cookie / header based locale switching #1315

Open
softmarshmallow opened this issue Sep 3, 2024 · 1 comment
Labels
documentation Improvements or additions to documentation unconfirmed Needs triage.

Comments

@softmarshmallow
Copy link

Link to page

No response

Describe the problem

The App directory example only contains for router based localese, it would be nice to have a "best practice" example for doing a header (accept language) + cookie (NEXT_LOCALE) based, user preference based local switching.

@softmarshmallow softmarshmallow added documentation Improvements or additions to documentation unconfirmed Needs triage. labels Sep 3, 2024
@amannn
Copy link
Owner

amannn commented Sep 3, 2024

Are you referring to an example that doesn't use an i18n routing setup? The corresponding setup guide links to an example with a cookie setup at the bottom. Does that help?

If you want to additionally consider the accept-language header, you could set that up in a custom middleware.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation unconfirmed Needs triage.
Projects
None yet
Development

No branches or pull requests

2 participants