I've also simplified the condition and added some comments on the redirect part but I'm not sure it's easy to read and understand this part so don't hesitate to give your opinion.
In the localeFromRequest function, there were several assignments that weren't necessary, so I merged them.
I removed the clone() call (from nextUrl) because it creates a new instance and it seems to be no longer documented on the doc, only on error messages
redirect
part but I'm not sure it's easy to read and understand this part so don't hesitate to give your opinion.localeFromRequest
function, there were several assignments that weren't necessary, so I merged them.clone()
call (fromnextUrl
) because it creates a new instance and it seems to be no longer documented on the doc, only on error messages