Skip to content
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

Merged
merged 3 commits into from
Mar 21, 2019

Conversation

kokspflanze
Copy link
Contributor

possible solution for #41

@coveralls
Copy link

coveralls commented Mar 19, 2019

Coverage Status

Coverage increased (+0.5%) to 82.857% when pulling e6d494d on kokspflanze:feature/default_locale into 2a8a0a6 on basz:master.

Copy link
Collaborator

@svycka svycka left a 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)) {
Copy link
Collaborator

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?

Copy link
Contributor Author

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) {
Copy link
Collaborator

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.

Copy link
Contributor Author

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.

@kokspflanze
Copy link
Contributor Author

@svycka added some tests, these are enough or you think that i missed smth?

@svycka svycka self-assigned this Mar 21, 2019
@svycka svycka merged commit bf7a75e into basz:master Mar 21, 2019
@svycka
Copy link
Collaborator

svycka commented Mar 21, 2019

whoops this should have been merged to develop

@kokspflanze
Copy link
Contributor Author

i can send you a revert commit in the evening for master if that is okay for you.

@svycka
Copy link
Collaborator

svycka commented Mar 21, 2019

@kokspflanze I already fixed and released 0.4.1 I hope everything will be okay

@kokspflanze
Copy link
Contributor Author

@svycka okay, i will add some more pull requests, next days. these will go in develop =)

@svycka
Copy link
Collaborator

svycka commented Mar 21, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants