Closed Rigo-m closed 4 weeks ago
There is an option not to add all locales to the regular expressions. Instead, the module can create a single common regular expression and, when navigating to a page, simply check the locale using a plugin. In theory, this should significantly reduce the routing complexity.
example: /:locale([a-zA-Z-_]{2,2})/subpage
If you can provide a simple example and instructions for testing, I will be able to evaluate the difference in approaches.
How can I help you with this?
How can I help you with this?
need make simple example and instructions for testing
I have a super simple solution in mind, will provide a PR
I suggest testing the new version, and if everything is fine, we can close the issue.
Vue-router tokenizer can be very slow when tokenizing complex regexes in the route matcher. Although this is more of a vue-router issue than a nuxt-i18n-micro issue, I was wondering if there was a faster implementation for the localized route (e.g.: checking the correct parameter via a route middleware).
The image above stems from a real-life project, with 70ish locales (en-us, en-gb, it-it etc).
Will try to provide a minimal reproduction, opening the issue to start a discourse