fairiessonia
fairiessonia
NNuxt
Created by fairiessonia on 5/23/2024 in #❓・help
Localized Custom Routing
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.
2 replies