If I have two different locales ("es-es" and "en-us"), but I want the url for the master language "es-es" to not have siteurl.com/es-es "es-es" at the end. How would that look like in the asyncData function? I have the same setup as your example on here
In my link-resolver.js I figure you can do something like this:
Another thing. What's the best way if I want to lose the "-es" and the "-us" in the locale url. Create a custom language with just the "es" and "en" as locale, or something else?
if (doc.type == "page" && doc.lang) {
return `/${doc.lang}/${doc.uid}`;
}
siteurl.com/UID or should have only one param presented in url: Here in code there will be an issue for understanding lang param as UID because the first param after root url is treated as lang, not as UID. Please seehere.
Another question Removal of ("-es" or "-us") from locale in the URL:
You need to use slice function of javascript to remove character from the url. You will find more detail here.
Let me know if you have any question on that.
Thank you,
Priyanka
1 Like
system
(system)
closed as resolved, flag & select 'Something Else' to reopen.
7
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.