Replies: 6 comments 7 replies
-
You can check out the official example which supports this: https://next-intl-example-app-router.vercel.app Edit: We now have official docs on error handling: https://next-intl-docs.vercel.app/docs/environments/error-files |
Beta Was this translation helpful? Give feedback.
-
@amannn Hi, |
Beta Was this translation helpful? Give feedback.
-
Hm, It's looks like doesn't work for |
Beta Was this translation helpful? Give feedback.
-
You need to add: import {notFound} from 'next/navigation'; export default function CatchAllPage() { P.S. read the documentation https://next-intl-docs.vercel.app/docs/environments/error-files |
Beta Was this translation helpful? Give feedback.
-
is there any solution to use Translation when i go to url for example localhost:3000/badurl ? I want to use translation in not found component but it doesn't work. Not found is same level with [locale] folder. I do not use localePrefix in url. i have urls like /login, but if I hit /en it switches to eng language and url redirects to /, thats fine. If i hit /fdasd it redirects not-found but i cant use translation in this level, can I avoid this ? |
Beta Was this translation helpful? Give feedback.
-
I'm looking at the guide (https://next-intl-docs.vercel.app/docs/environments/error-files) I am wondering if there is an easy way to deal with "Catching non-localized requests". The method involves adding extra files and code. Seems redundant. Shouldn't the middleware be able to detect this? |
Beta Was this translation helpful? Give feedback.
-
Hi, I'm using this library with the next.js app directory and would like to localize not-found.tsx. But the problem is that if the user visits some non-existing page, next.js tries to redirect him to not-found.tsx which is in the root of the app directory (and root layout is in [locale] directory). But I would need to get him to not-found.tsx in the [locale] directory or get translations in /app/not-found.tsx.
Thank you very much for your advice.
Beta Was this translation helpful? Give feedback.
All reactions