Next.js: What’s the best practice for determining the user's language/locale?
Answered
Atlantic herring posted this in #help-forum
Atlantic herringOP
What’s the best practice for determining the user's language/locale?
I’m working on adding internationalization to my web app, and I’m wondering what the best practice is for deciding which language to show by default. There are several ways to determine this, like region/location, user settings, or browser language. What’s the recommended approach?
I’m working on adding internationalization to my web app, and I’m wondering what the best practice is for deciding which language to show by default. There are several ways to determine this, like region/location, user settings, or browser language. What’s the recommended approach?
Answered by B33fb0n3
When following the docs, it's the user's language preference, that's selected in the browser ([read more](https://nextjs.org/docs/app/building-your-application/routing/internationalization#routing-overview))
7 Replies
@Atlantic herring What’s the best practice for determining the user's language/locale?
I’m working on adding internationalization to my web app, and I’m wondering what the best practice is for deciding which language to show by default. There are several ways to determine this, like region/location, user settings, or browser language. What’s the recommended approach?
When following the docs, it's the user's language preference, that's selected in the browser ([read more](https://nextjs.org/docs/app/building-your-application/routing/internationalization#routing-overview))
Answer
@B33fb0n3 When following the docs, it's the user's language preference, that's selected in the browser ([read more](https://nextjs.org/docs/app/building-your-application/routing/internationalization#routing-overview))
Atlantic herringOP
So, it’s pretty much just handled by the middleware?
@Atlantic herring So, it’s pretty much just handled by the middleware?
yes, the middleware handle all the redirection and the rest is handled as jsons
@Atlantic herring solved?
@B33fb0n3 <@277895599460974592> solved?
Atlantic herringOP
yea i just need to implement it 😄
@B33fb0n3
Atlantic herringOP
It works btw 🙂 Thanks for your help all the time 🙂