victorgarciaesgi / nuxt-typed-router

🚦Provide autocompletion and typecheck to Nuxt router
https://nuxt-typed-router.vercel.app
MIT License
362 stars 12 forks source link

fix(i18n): ignore i18n modifiers #153

Open Alolu opened 5 months ago

Alolu commented 5 months ago

Description

This PR solves the issue #149, where router dependent functions such as localePath or nuxtLinkLocale would break if i18n was on with the strategy prefix_and_default, the bug might occur with other strategies, this has not been tested for the moment.

An option has been added ignoreI18nModifiers set by default to false to assure backwards compatibility, setting the option to true will prevent the generator from changing the routes names.

nuxtTypedRouter: {
   ignoreI18nModifiers: true //default false
}

I haven't found any functionality that has been broken from this change yet

victorgarciaesgi commented 5 months ago

Thanks for your PR! Sorry the code is a mess, i have a plan to refactor everything for 4.0 but lack motivation 😂 I'll test this