Replies: 2 comments 1 reply
-
|
Your even listener is definitely on the right track, and I have a feeling it's working on some of your links and not others. Anything that already rendered on the page won't be updated, but new calls to For stuff like this, particularly with locales since all your links will change, I would suggest forcing a full page reload on the one request where the locale is changed. The alternative would be a combination of what you're doing now and also refactoring to ensure that every place you're using |
Beta Was this translation helpful? Give feedback.
-
|
Old thread, but I had a similar problem and solved it by forcing reload of the page when user changes the locale. My best bet on why it helps is since we're talking Inertia here, your PHP code |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I'm using Laravel & Inertia for my project.
All my routes have prefix
/{route}/.I have
SetLocale.phpmiddleware that does someting like:And I have a Inertia Link that changes the locale.
The link changes, but my
route()links stay in the previous locale.Ok, I understand that I'm using
@routesblade directive and the links are sent only once, but I tried something like:But no luck.
I know that I can use
<a href=""instead of<Link href=""but I don't think its ideal because I want to preserve my form states.Any ideas ?
Beta Was this translation helpful? Give feedback.
All reactions