QuiiBz / next-international

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

Possibility to change LOCALE_COOKIE constant #305

Open ricardo-fnd opened 7 months ago

ricardo-fnd commented 7 months ago

Is your feature request related to a problem? Please describe. I have a monorepo with some frontend apps. This apps are looking for a NEXT_LOCALE cookie when looking for currentLang. Now I'm integrating one of the apps (website) to use next-international.

For the other apps to continue working, I will need to change the cookie name in all apps to Next-locale and I'll need also a migration, so users with NEXT_LOCALE cookie won't be affected by this. I'll need to copy NEXT_LOCALE content to Next-locale cookie in all apps.

Describe the solution you'd like We should be able to change LOCALE_COOKIE constant. createI18nMiddleware should probably accept this argument.

QuiiBz commented 7 months ago

Let's add this option in the next release!