QuiiBz / next-international

Type-safe internationalization (i18n) for Next.js
https://next-international.vercel.app
MIT License
1.26k stars 59 forks source link

useCurrentLocale is working but not useI18n #183

Closed zackrw closed 11 months ago

zackrw commented 12 months ago

Describe the bug In a client component, I have useCurrentLocale() working (e.g. returns 'pt-BR') and getI18n() working on the SSR wrapper page. But useI18n is a no-op here.

Everything works on the homepage "/:locale", but on "/:locale/dashboard" it does not. changeLocale() is also not working on the dashboard. Has anyone else seen route-specific bugs?

image

About (please complete the following information):

QuiiBz commented 12 months ago

Can you share your middleware configuration, and share the code/a reproduction?

The example here works fine on a subpage: https://github.com/QuiiBz/next-international/blob/main/examples/next-app/app/%5Blocale%5D/subpage/page.tsx

QuiiBz commented 11 months ago

Closing as no reproduction has been provided. Feel free to re-open if needed!

zackrw commented 11 months ago

I figured this out BTW. It was because a single client component was accidentally async, which caused everything to hang and/or behave unpredictably.