-
-
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
Can't switch to specific locale *by path* if route path was customized #641
Comments
It's not really about #554 as that one just matched what was already possible before (your second test). The thing is that is not really supposed to work. In theory, we could try to come up with some solution but that would be an extra feature that would require storing a map of paths assigned to a specific route. |
Those finding this issue should know that it works when passing route's "name" to Every page route has a name attached to it. They follow certain pattern but if unsure, one can always look inside generated |
I'm having the same issue, even without supplying the second parameter with the alternative language it's not working sometimes for customized paths. (An alternative to using the |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
It's also not working for me. Or is there a way to fix this / support this functionality? |
The docs could always be improved to make things clearer.
There is. That's why this feature request is open. :) |
Is the following what you mean by "customized"? nuxtI18n: {
paths: {
de: '/karriere',
},
}, |
Yes. This or through the |
Okay, I just checked it, and yeah you're right. So basically Please correct me if I'm wrong, but it feels like supporting customized paths for this path-parameters shouldn't be too difficult, right? |
It's fairly complex to implement that in a robust way. To add to that, there is currently no support for custom paths when using NO_PREFIX strategy but there should be. That needs to be taken into consideration when implementing this feature. There is some veeeery early attempt at that in https://github.com/nuxt-community/i18n-module/tree/fix/no-prefix-rename |
Please hold off announcing a fix before it's properly tested and reviewed. |
Should be fixed by #1088 |
Version
v6.7.0
Reproduction link
#554
Steps to reproduce
Please add following tests:
Which will fail as both will result in /fr/about-us instead of /fr/a-propos
Tested with master branch.
What is expected ?
localePath('/about-us', 'fr') to be /fr/a-propos
What is actually happening?
localePath('/about-us', 'fr') becomes /fr/about-us
Additional comments?
Using the older way with route names still works correctly, but this usage would make my life easier.
The text was updated successfully, but these errors were encountered: