I use nuxt-i18n to get internationalization in my application. I have a list of news that gives me routes like that :
myapp.com/news (default language English)
myapp.com/fr/news
myapp.com/it/news
when i click on a news i want to reach th _id page to get only only the news i clicked on. so i did this in a method (onclick) :
onLoadNews(id) {this.$router.push("/news/" + id);}
But this way I always return to English default language. How to push a locale route (in the function of a method) this way?
this.$router.push(this.localePath({ name: "news-id", params: { id } }));
that worked for me because i have a folder "news" and inside two vue pages the index.vue and the _id.vue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With