Closed juriansluiman closed 11 years ago
@juriansluiman all makes sense to me
@basz I finally had time to finish the tests for this refactoring. All is green, for now. I commented out three tests which I did not understand:
About that last point: if you have a route "en" en you have the language "en", it becomes the route "en/en". If you perform the above redirect and start at "en", then you're redirected to "en/" so the "/en" is made "/". I can't imagine it will happen often, but is is a drawback of automated redirection. Thoughts?
Merging now, we can reimplement above features at any time (v0.0.1 is still featuring the old code).
I think (it's been a while) I wanted to make sure that when an locale is detected in the first segment of an path, behavior was similar to that of apache encountering a directory regardless of the redirect option. http://blah.com/something is http://redirected to blah.com/something/
Basicly an insurance against developers forgetting the trailing slash and preventing a 404. But when I think about it now it feels a bit overly concerned and it is introducing magic which we can do without.
It would require additional logic at https://github.com/juriansluiman/SlmLocale/blob/94d5496e9631d2f59e5e584257a6a20d5cf71fb5/src/SlmLocale/Strategy/UriPathStrategy.php#L169 or something similar what I had at https://github.com/juriansluiman/SlmLocale/commit/bed19e43e565a124709ad7e022970ecac4ec3e83#L0R121
But honestly, perhaps it's better to take a step back and remove that...
@basz I am refactoring SlmLocale now. If you'd like, please review :) This is still WIP.
The need for refactoring is for a couple of reasons: