Next.js Discord

Discord Forum

Should we use proxy for internationalization? Ambiguous docs

Unanswered
Ratonero Mallorquin posted this in #help-forum
Open in Discord
Ratonero MallorquinOP
Looking at the page for internationalization the first and only example on how to handle that employs the function of a proxy.js file:
https://nextjs.org/docs/app/guides/internationalization

At the same time, reading about the rename from middleware to proxy at https://nextjs.org/docs/messages/middleware-to-proxy there are these passages:

The reason behind the renaming of middleware is that the term "middleware" can often be confused with Express.js middleware, leading to a misinterpretation of its purpose. Also, Middleware is highly capable, so it may encourage the usage; however, this feature is recommended to be used as a last resort.

We recommend users avoid relying on Middleware unless no other options exist. Our goal is to give them APIs with better ergonomics so they can achieve their goals without Middleware.

The term “middleware” often confuses users with Express.js middleware, which can encourage misuse.

So which is it, are we at our last resort trying to solve language handling, or should one use some other method?

0 Replies