Closed KULTI1995 closed 1 year ago
Really need this feature too
It seems like getStaticPaths does not get the translated routes from the _routes.json file. It looks like it's impossible to combine this library with SSG sadly. I hope this feature will be added soon.
Edit: I made it work, going to post the solution later.
Hi, @draxx318 is there any improvements on solution?
Sorry, I don't get it, could you explain your issue?
I also have some getStaticPaths
and it works well...
You should not have anything to do here: getStaticPaths
creates the dynamic file paths, which is then redirected and rewritten using next-translate-routes.
Sorry, I don't get it, could you explain your issue? I also have some
getStaticPaths
and it works well... You should not have anything to do here:getStaticPaths
creates the dynamic file paths, which is then redirected and rewritten using next-translate-routes.
I am facing the same problem : getStaticProps does not work with translated routes if you refresh the page, props will pass from getStaticProps to the page. but if you click the Link from translateRoute, the page wont grab props from getStaticProps
It seems like getStaticPaths does not get the translated routes from the _routes.json file. It looks like it's impossible to combine this library with SSG sadly. I hope this feature will be added soon.
Edit: I made it work, going to post the solution later.
Can't wait to see your solution!
:thinking: Strange... I don't have this issue anywhere. Could you provide a minimal reproduction?
I just found out that if your file contains middleware.ts, getStaticProps will immediately fail.
Do you guys support, generating the correct link ?
E.g. we have articles in different languages
https://nextjs.org/docs/advanced-features/i18n-routing#dynamic-routes-and-getstaticprops-pages