Next.js Discord

Discord Forum

Best practice for passing i18n dictionary object in Next.js 15 App Router?

Unanswered
Band-tailed Pigeon posted this in #help-forum
Open in Discord
Band-tailed PigeonOP
Hi, I need some help. In my page.tsx, I'm calling my i18n dictionary object dict. How should I use this object in other places? Should I use Zustand?
Or should I keep passing it down through props?

4 Replies

Barbary Lion
Do you use a specific i18n library?
Band-tailed PigeonOP
No, I just follow the offical document
https://nextjs.org/docs/app/guides/internationalization
Northeast Congo Lion
Have you solved it now?
Barbary Lion
The best way is too avoid using your dictionary on the client side because it can be very big and you dont want you client side bundle to be big.

But if if you really want I would suggest to create a dictionary provider with a useDictonary hook. You can do this with zustand but a simple React context with a hook will do the job too!