Replies: 1 comment
-
Hey, glad to hear that next-intl works well for you! 🙂 There's some background on the locale passing here: For next-intl, it seems to be the right choice with the header (and optionally the The ideal solution for this problem would be vercel/next.js#58862. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I have been using next-intl for a couple of days and you did such a great job! I really like it for it's simplicity to use and clean implementation. I am fairly new to next.js so I hope you don't mind if I ask you some questions about it, because I have a similar use case. More specifically, I want to know how do functions like getLocale() on the server work. I can see in the middleware, that you are setting a cookie and a header, but I couldn't find anywhere where you are reading it outside the middleware.
Currently, I have a [store] route with a layout in it. And, I setup a context provider to use this store value in all the client components where it's needed, but for server components I am just prop drilling it down, which I am not a fan of. Ideally, I would have an asyncronous function getStore() that give me the store value. For this to work, I guess I have to set the cookie and the header in the middleware, but then how do I actually read it?
Beta Was this translation helpful? Give feedback.
All reactions