You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, so I followed the documentation and looks like having prefixes in my URLs works well, but if I omit the locale in the URL my app breaks and tries to redirect to 404 (also fails there as well). It's like next-int does not pick defaultLocale from the middleware config.
My middleware:
exportdefaultcreateMiddleware({// A list of all locales that are supportedlocales: LOCALES,// Used when no locale matchesdefaultLocale: 'de',localePrefix: 'never',// I also tried 'as-needed` and 'always'});
Logging locale prop inside layout.tsx without the prefix it returns the route name for locale prop instead of a prop (should be a default one de I assume if prefix is missing?)
In my app directory everything (page, layout, not-found, error) is nested inside of [locale] folder only api folder is in the root of app.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello, so I followed the documentation and looks like having prefixes in my URLs works well, but if I omit the locale in the URL my app breaks and tries to redirect to 404 (also fails there as well). It's like next-int does not pick
defaultLocale
from the middleware config.My middleware:
Logging
locale
prop insidelayout.tsx
without the prefix it returns the route name forlocale
prop instead of a prop (should be a default onede
I assume if prefix is missing?)In my
app
directory everything (page, layout, not-found, error) is nested inside of[locale]
folder onlyapi
folder is in the root ofapp
.Am I doing something wrong?
Thanks for help. :)
Beta Was this translation helpful? Give feedback.
All reactions