feat: add possibility to disable default redirect for prefix_and_default strategy
Regarding to issue #1401
Added property to config:
i18n: {
disableDefaultRedirect: boolean | string[] // false by default
}
It works only for strategy prefix_and_default. It disables redirect for routes are prefixed with default language, or we can choose custom path pattern for disabling redirect behaviour:
i18n: {
disableDefaultRedirect: [
'/about',
'/blog/*'
]
}
UPD:
Added property to config:
type PrefixAndDefaultRule = 'default' | 'prefix'
i18n: {
prefixAndDefaultRule?: PrefixAndDefaultRule
}
By setting the value prefixAndDefaultRule = 'prefix' we are no longer redirected from prefixed routes and if there is no prefix then the other routers will also have no prefix.
For now, I decided not to implement an array with a list of routes for which the default behavior is disabled
rchl Thanks for the quick review. Unfortunately, I will only be able to continue working on the task today. I decided to abandon the route array and changed the implementation following your advice. Updated the information in the first post
Corrected the code that was causing the tests to crash
I need this feature ! please, thanks... @Renhor any update bro?
This feature would be highly appreciated. Get in touch with me, if there is anything I can do.