Hello everyone, I am fresh on Prismic + nodejs, until now I could "handle" the multilingual setup, but I have a question:
How can we change the defaults values from language? For instance, I want the url to be. like: site.com/pt/page-name instead of site.com/pt-pt/page-name
On this example, how can we change the /:lang value on the app.get() outputted url?
I mean, I want to keep using the given lang value from Prismic on my code (pt-pt), but I want to output a simplified value on the urls. Just "pt" instead of "pt-pt".
We retrieve the values of lang and uid like you mentioned from req.params.
we make the query using the params and send it to prismic using async/await, as you mentioned.
If I understood your case correctly, you want the lang parameter to be different in step 1 and step 3. For doing that, you need to handle this on the front-end only. For example, you can have a common place for creating a map and you can use this map for mapping values of your site. In your case, it will be like {"pt", "pt-pt"}, And you can use it to switch the params value from Step 2, before triggering a query in Step 3.
For example, even if your site is having a URL like: site.com/pt/page-name, you can switch the lang param using a map, and send the lang as pt-pt.
I hope that answers your question. Let me know if it does not.
Thank you,
Priyanka
1 Like
system
(system)
closed as resolved, flag & select 'Something Else' to reopen.
4
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.