-
Notifications
You must be signed in to change notification settings - Fork 34
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
Don't redirect to default locale #103
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add tests for this feature? thanks.
@@ -74,6 +76,9 @@ public function setOptions(array $options = []) | |||
if (array_key_exists('redirect_to_canonical', $options)) { | |||
$this->redirect_to_canonical = (bool) $options['redirect_to_canonical']; | |||
} | |||
if (array_key_exists('default', $options)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure about one more default locale we already have one maybe we could use an old one instead of this or this is not possible here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i dont know how to access the default locale, so i added a new one just for the strategy. thats also the key to enable the feature
@@ -196,7 +201,12 @@ public function assemble(LocaleEvent $event) | |||
// Remove first part | |||
array_shift($parts); | |||
|
|||
$path = $base . '/' . $locale . '/' . implode('/', $parts); | |||
$locale .= '/'; | |||
if ($locale === $this->default) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this correct? to be true default value should be set to something like en/
with /
at the end.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
50/50
in fallback it should be with /
, because i removed it some lines down.
@svycka added some tests, these are enough or you think that i missed smth? |
whoops this should have been merged to develop |
i can send you a revert commit in the evening for master if that is okay for you. |
@kokspflanze I already fixed and released 0.4.1 I hope everything will be okay |
@svycka okay, i will add some more pull requests, next days. these will go in develop =) |
okay, :D that was a bit my fault because I forgot about develop branch when I saw 0.y.x version. I don't have develop branch unless it's already 1.0.0. But I guess we can release 1.0.0 |
possible solution for #41