Don't force to add untranslatable pathnames to pathnames: {} in routing.ts #2045
Answered
by
amannn
alexclinky
asked this question in
Q&A
-
Hi, I am referring to this: If my app has 100 pages, I don't want to add paths that i don't need translations. If I don't I get an error from import { Link } from "@/i18n/navigation"; |
Beta Was this translation helpful? Give feedback.
Answered by
amannn
Oct 7, 2025
Replies: 1 comment
-
You can either opt-ouf for specific cases, or you can disable type safety altogether with something like: import {defineRouting} from 'next-intl/routing';
export const routing = defineRouting({
locales: ['en', 'de'],
defaultLocale: 'en',
pathnames: {
'/pathnames': {
de: '/pfadnamen'
}
} as any // This disables validation of pathnames
}); If there's no matching entry in your config, |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
alexclinky
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can either opt-ouf for specific cases, or you can disable type safety altogether with something like:
If there's no matching entry in your config,
next-intl
will fall back to assuming no translated variants are available.