Skip to content
Discussion options

You must be logged in to vote

Thanks for the kind words, I try to help when I can!

Hmm, I see your concerns! It seems like it takes some intricate logic to unify the routing patterns to support both custom domains and IDs in your middleware. But generally, looking at other middleware examples it's quite common to include logic that introduces conditions based on pathname patterns. So all in all, I think this might be fine. But I only have a limited understanding of your app, this is just my outside perspective.

then pass the locale to a header and fetch that header in i18n/request.ts

That's probably the only part I'd reconsider. If you can pass the locale to a header, you could also use it as a route segment instead…

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@rickvdbroek
Comment options

@amannn
Comment options

@rickvdbroek
Comment options

@amannn
Comment options

Answer selected by rickvdbroek
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
enhancement New feature or request unconfirmed Needs triage.
2 participants
Converted from issue

This discussion was converted from issue #1746 on February 26, 2025 08:37.