-
-
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
localePath remove unused params that should be sent as props to router-view #728
Comments
It would be helpful if you would set up a repro project on codesandbox for example. I guess router-module configuration is also relevant here. |
Yes, I did not have time to create one yesterday. |
As you can see, when you click «params bug», the stopId param is missing (the object is printed bellow the buttons) because it uses localePath. If you click on «params ok», the stopId param is passed because we translate the |
I don't see how I could make it work with So it's not really equivalent to using Adding a new API to achieve what you want would probably be the best option. For example just add a way to resolve the name of the localized route so then you could construct a Maybe |
I understand all that.
|
If we would return object, people would need to do So the |
What do you think about updated #729 @mrleblanc101 ? |
Looks good to me. I would've simple changed |
I haven't added |
Oh I must be confused, I thought I saw that |
Also, thank you for the very fast follow up. I see this is already merged and published on NPM ! 😁 |
Version
nuxt-i18n: 6.3.0
nuxt: 2.10.1
Nuxt configuration
mode:
Nuxt-i18n configuration
Hi,
I'll start by mentioning I'm using router-module with Nuxt and that this issue is caused by the interaction of the 2 modules, but the problem is with nuxt-i18n and not router-module.
What is Expected?
app.localePath()
should only append the language to thename
key of the object, it should not transform the object as a URL string as you can pass params that won't be in the URL, but that gets passed to the router-view when using theprops
option. More info here.What is actually happening?
app.localePath()
transform the router-link object to a string which remove all params that are send but are not displayed in the URL.For exemple:
turn into
myapp.com/parcours/stop/hollywood-blvd
which looks good, but now my router-view won't receive thestopId
as a props.If you have this problem, I found that I could access the locale directly and append the language to the name of my route like so instead of using the localePath fonction:
I'm not sure if the best way to solve this problem is to change the way the current localePath fonction works or add a new localeObject (example) fonction
The text was updated successfully, but these errors were encountered: