How to handle next-intl mixed routing?
Unanswered
Xoloitzcuintli posted this in #help-forum
XoloitzcuintliOP
I have a case where I need some subroutes (within the same layout tree) to support more locales than the rest of the app. So there is for example
Questions:
Is there a built-in or recommended approach within next-intl for handling this “partial locale” setup?
Or should I write a custom middleware.ts that adjusts routing and detection so links work correctly when navigating between pages that have different locale availability?
Any patterns to help guide me would be helpful!
/forms
directory which needs to have ['en', 'es', 'de', ...]
and rest of the app requires only ['en', 'es']
. The next-intl
examples have mixed routing here: https://next-intl.dev/examples#app-router-mixed-routing). But that example is for “no-locale + locale” routes — not “subset vs superset” locale groups.├─ [locale]/
│ ├─ layout.tsx
│ ├─ page.tsx # (more pages like this with only en/es)
│ └─ forms/ # (en,es,de, ...)
│ ├─ layout.tsx
│ ├─ page.tsx
│ └─ [slug]/page.tsx
Questions:
Is there a built-in or recommended approach within next-intl for handling this “partial locale” setup?
Or should I write a custom middleware.ts that adjusts routing and detection so links work correctly when navigating between pages that have different locale availability?
Any patterns to help guide me would be helpful!