When defining routes I’d like the option to use “smart” route helpers, as in, they can infer the path param value.
Let’s say this is the router configuration:
scope "/:locale" do
live "/home", HomeLive, :show
live "/contact", ContactLive, :show
If I’m currently on the page /en/contact I want to use the helper home_path(@socket, :show) without specifying the :locale param. We can assume I can access that value somewhere, like having it in socket.assigns.locale.
Same goes for e.g. /de/contact, I want router_path(@socket, :show) to generate the path /de/home.