I have created NextJS app using a CMS with multiple languages support. Here I have added a slug to identify the URL in the preview and live version of the CMS. It works fine when I used the same slug for all different languages but not when using a different slug.
Furthermore, it is not working when I change the language from the frontend side. Because the URL will be created with the previously selected language. To fix this issue I need to get the slug from the CMS based on the selected language, and then get the content from the CMS.
Taking a quick look at the plugin, it seems that for you to achieve that desired behaviour, you would have to also provide a $locale variable to be coupled with the $slug parameter when filtering for posts using the request inside the plugin.
This way you can couple the $slug with the $locale variable, and create an unique path, even if the slugs are the same, lets say:
pages/$locale/$slug
that would make two unique paths, for the different locales, even if the slugs are the same
Did we create a static page with a dynamic name? For example, I have created a page named landing in Frontend (NextJS app) and added a different slug in CMS as events, landing or something else. In this case preview is not working.
In particular, I was worried about redirecting on frontend using the slugs added to the CMS. I am having difficulty dealing with dynamic slugs as well as multiple languages. Do you have any suggestions for how we can do this better?