-
-
Notifications
You must be signed in to change notification settings - Fork 483
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Favour no prefix default route when using prefix_and_default_strategy #721
Comments
Please give a specific example where it doesn't work (ideally with configuration you are using). |
Thanks for your answer. Here our i18n configuration :
Our default locale is In our code a |
If you hover the link is it I can't reproduce in https://codesandbox.io/s/nuxt-i18n-issue-721-e8mzf?file=/pages/index.vue |
I am trying to reproduce the problem by forking but no I can't ... Trying to play with the packages version. If I hover the link it is |
Well I have there https://codesandbox.io/s/nuxt-i18n-issue-721-kw2eg?file=/nuxt.config.js
Investigating this... |
You have included |
I have succeeded reproducing the problem here : https://codesandbox.io/s/vibrant-dream-widiw?file=/nuxt.config.js As you can see the route with |
Right, I can see the problem now. BTW. Your test is ambiguous as the outcome of the test depends on the currently selected locale and we can't see or change that. Here is a better test: https://codesandbox.io/s/stoic-cache-li0bt?file=/pages/index.vue . Or you could explicitly ask for Also, the bug wouldn't trigger if you would pass the route name ( But it's a bug nonetheless. |
Thank you for your quick answer ! Indeed using the route name works
I am not sure I have understood this statement. Using |
|
I still dod not get it. If the current locale is |
Only default locale has prefix-less path. In that test the English route only has So when you call |
Ah yes sorry I am confusing myself :D.... So to sum up and to clarify for whoever has the bug: if we look at the doc https://nuxt-community.github.io/nuxt-i18n/basic-usage.html#nuxt-link Using Routes by path Current solution to avoid the bug is to use route by name |
That's correct. But it's still a bug that resolving by path doesn't select the most optimal option and that will be fixed. |
When using "localePath" with a route path argument (rather than route name), there was a bug with picking prefixed route path for default route rather than preferred non-prefixed path. Resolve #721
When using "localePath" with a route path argument (rather than route name), there was a bug with picking prefixed route path for default route rather than preferred non-prefixed path. Resolve #721
I have same problem! |
Well, this bug was fixed so yours is probably not the same. Create a new issue with clear reproduction steps. |
I am using the
prefix_and_default strategy
. Let's say my default locale isen
. I would like to favourwww.foo.com/blog
rather thanwww.foo.com/en/blog
.It seems that the routes with prefix are favoured. How can favour the other way ?
I am in PWA mode and using
yarn dev
.The text was updated successfully, but these errors were encountered: