Localized Custom Routing

Has anyone been able to get the localized custom routing for the nuxt 3 i18n module to work? I’ve followed the docs below to a tee but can’t seem to get it to work. https://v8.i18n.nuxtjs.org/guide/custom-paths
Custom route paths
Customize the names of the paths for specific locale.
1 Reply
fairiessonia
fairiessoniaOP7mo ago
SOLVED: if you have manual routing done on the same page, or from other pages to the page you're trying to set the custom route paths for, the routing needs to be based on the locale AND the new route path e.g.
router.push({
path: locale.value == "en" ? "/en/sample-route" : "/ms/laluan-contoh",
query: sampleQuery,
});
router.push({
path: locale.value == "en" ? "/en/sample-route" : "/ms/laluan-contoh",
query: sampleQuery,
});
If you otherwise try to set it based on the filepath e.g.
locale.value == "en" ? "/en/original-filename" : "/ms/original-filename"
locale.value == "en" ? "/en/original-filename" : "/ms/original-filename"
, this will interfere with the nuxt config as shown on the documentation page linked above.
Want results from more Discord servers?
Add your server