In Next.js, when using next-translate i18n plugin with dynamic routes, it does not work with non-default locale.
I have 2 locales. Arabic "ar" and English "en". The default locale is "ar".
When I access this URL for example: domain.com/post/1 it appears as expected and shows the Arabic content.
On the other hand, when I try to access the English version of the same post through this URL: domain.com/en/post/1 it doesn't appear and gives 404 (Not Found) error.
How to fix this issue?
Here is a full example representing how to generate dynamic paths for both default and non-default locales when using
text-translatei18n internationalization plugin with dynamic routes in Next.js:.