Next-Intl how to automatically set the current locale as a header to outbound api requests

152 views Asked by At

We are using the nextjs app router, along with next-intl server components. We would have an external api and would like to send the current locale to the api with every api request. We are thinking we should be able to do this in the middleware quite easily as opposed to everywhere we construct a request, but are left wondering how we can get the "current locale" to send inside the middleware. Is the best strategy to check for a cookie?

0

There are 0 answers