This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Set locale
after the request
#1746
Labels
You can continue the conversation there. Go to discussion →
locale
after the request
#1746
Is your feature request related to a problem? Please describe.
Currently I have a database with a table called
projects
, on that entity I have a property calledlocale
. Now, a simplified version of my codebase, is:Now on the page level for the view I request my Drizzle ORM to get the project based on the
[id]
. Only after I get that data back, in other words "after" the request, I know what the locale needs to be.Describe the solution you'd like
The solution I am proposing is to give
setRequestLocale
new purpose. I am aware that you wan't get rid of it for reasons I understand. However it might still be useful, maybe in a different form, for cases where internationalization happens after the request.Describe alternatives you've considered
Now what I've tried is:
Attempt #1
Attempt #2
In another communication channel you've referred to the upcoming rootParams feature in Next.js. Now that would also work if that function can be called in
src/i18n/request.ts
retrieving the[id]
. That would mean I do my Drizzle ORM call in thesrc/i18n/request.ts
to retrieve the project their. That would also mean I need to efficiently need to cache my Drizzle Query to prevent unnecessary database queries, but that's fine.However I have my doubts since the
request.tsx
file lives outside the dynamic segment folder.The text was updated successfully, but these errors were encountered: