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
I'm having trouble with my Next.js application using next-intl for internationalization. Specifically, I'm struggling with the default language behavior when using localePrefix: 'as-needed'. My goal is to assign english to the root / and in languages I would love to have the prefix /de, /it and so on. I tried different approaches, and so far I only have a solution, that I get redirected to the root language. But as soon as I write other paths that exist, for example /about/me, I get 404 error (since this "language" is not found). So I would love to have a clean approach, and set /en as default.
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
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone,
I'm having trouble with my Next.js application using next-intl for internationalization. Specifically, I'm struggling with the default language behavior when using localePrefix: 'as-needed'. My goal is to assign english to the root
/
and in languages I would love to have the prefix/de
,/it
and so on. I tried different approaches, and so far I only have a solution, that I get redirected to the root language. But as soon as I write other paths that exist, for example/about/me
, I get 404 error (since this "language" is not found). So I would love to have a clean approach, and set /en as default.Here's my current setup:
Beta Was this translation helpful? Give feedback.
All reactions