revalidatePath() with custom pathnames #1164
Unanswered
markoleavy
asked this question in
Q&A
Replies: 2 comments
-
Have you seen How can I revalidate localized pathnames? in the docs? |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hi Jan, A part from that here's some consideration I've made while debugging revalidation. Most of them probably concern Next and Vercel, but they might be useful things to be aware of:
app
└── [locale]
└── blog
└── [...blog]
└── page.tsx // leads to '/blog/categories'
└── a
└── [post]
└── page.tsx // leads to '/blog/a/my-post'
└── page.tsx // leads to '/blog'
└── product
└── [product]
└── page.tsx //leads to '/product/3244121'
└── page.tsx // leads to '/product'
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
When using
pathnames
to translate folders/slugs, revalidating a translated path does not work.Example:
[locale]/product/page.tsx
.product
isprodotto
for locale == 'it'./it/prodotto/1234
I need to callrevalidatePath('/it/product/1234')
.I'm writing an horrible workaround with switch and replace().
Does anyone has a smarter idea to fix this problem?
Beta Was this translation helpful? Give feedback.
All reactions