next-international icon indicating copy to clipboard operation
next-international copied to clipboard

Saving and loading language preference from persistent storage

Open zdychacek opened this issue 10 months ago • 0 comments

Is your feature request related to a problem? Please describe. I am missing feature to load language preference from DB. I have a user table with language field and I would like to load this preference and set the language accordingly.

Describe the solution you'd like I am wondering about solution like resolveLocale calback, which should be allowed to do asynchronous call.

Describe alternatives you've considered I tried resolveLocaleFromRequest callback but this is called only if Next-Locale cookie is not set and callback is synchronous so there is no way to call DB. I am using Prisma and when I try to call DB, i got an error:

Error: PrismaClient is not configured to run in Vercel Edge Functions or Edge Middleware. In order to run Prisma Client on edge runtime, either:
 - Use Prisma Accelerate: https://pris.ly/d/accelerate
 - Use Driver Adapters: https://pris.ly/d/driver-adapters

If this is unexpected, please open an issue: https://pris.ly/prisma-prisma-bug-report

Thanks for your work ont this project and I am waiting for you response.

Ondrej

zdychacek avatar Apr 04 '24 07:04 zdychacek