s00d / nuxt-i18n-micro

Nuxt I18n Micro is a fast, simple, and lightweight internationalization (i18n) module for Nuxt
https://s00d.github.io/nuxt-i18n-micro/
MIT License
87 stars 11 forks source link

Using named routes with params seems not to work with $localeRote #10

Closed exophunk closed 2 months ago

exophunk commented 2 months ago

Reproduction: https://stackblitz.com/edit/nuxt-starter-zhtyjz?file=pages%2Findex.vue

Whenever I try to use a route with route parameters, it does not work when using with $localeRoute(). As far as tried, I could not use route parameters in any of those cases:

It throws an error saying the param is not found, like: Missing required param "id"

s00d commented 2 months ago

I fixed it and found another bug related to redirects when includeDefaultLocaleRoute was enabled. I fixed that too, please review.

exophunk commented 2 months ago

Fixed 99%. Thank you

The issue persists for <NuxtLink :to="$localeRoute('/page/id-123')"> Broken Link </NuxtLink>

everything else is fine. thank you!

Updated reproduction with 1.13.4: https://stackblitz.com/edit/nuxt-starter-gax6db?file=pages%2Findex.vue

s00d commented 2 months ago

fixed 100% :)