-
-
Notifications
You must be signed in to change notification settings - Fork 508
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
hideDefaultLocaleInURL = TRUE laravel 5 session issue #219
Comments
+1 |
2 similar comments
+1 |
+1 |
+1 this is annoying bug :) |
Any plans to fix this (major) bug? Thanks! |
+1 |
+1 |
I think I fixed it by changing LocaleSessionRedirect.php to this: https://gist.github.com/mxmtsk/308badf0b9553aabe86e It works for me, if you guys could try it also. I basically put line 26 before line 19 because $locale was undefined in the first if statement. |
@mxmtsk, try to make a PR to see if it's gonna pass all the tests or not. |
I have merged your PR and adapted it to version 1.1 and 1.0. Thanks for your help! |
It looks like an exception went through that fix, at least for me. When setting hideDefaultLocaleInUrl to true I had trouble switching language through the url. Let's say I was on the page Therefore I stumbled on this post that gave me the direction for where to look at. I found that adding this snippet on line 33 of the LocalSessionRedirect.php class does the trick for me:
So far I could not find any issue with it. If that makes sense for it to be implemented by default, I'm more than happy to do a PR. By the way, if there would be anything wrong with this snippet, feel free to let me know. I just tried the package for the first time today. ❤️ |
I have two enabled languages: "en" (default) and "ru"
When I am adding /ru to url - app automatically writes "ru" as selected language in session:
http://example.com/ru/auth/login (sets session locale to "ru")
But when using default url with hideDefaultLocaleInURL set to TRUE it doesn't update the session locale:
http://example.com/auth/login (redirects to http://example.com/ru/auth/login instead of updating session locale to default "en").
The temporary solution is to call http://example.com/en/auth/login that will redirect to http://example.com/auth/login and will set session locale to en.
This issue also prevents the translation selection combobox to work right:
getLocalizedURL returns example.com/auth/login instead of example.com/en/auth/login (if session locale is set to "ru" it will not update it to "en")
Please fix this issue or just write a "tip" about this.
Thanks!
The text was updated successfully, but these errors were encountered: