-
Notifications
You must be signed in to change notification settings - Fork 6
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
Browser Language Detection not working on Mobile Safari / iOS #6
Comments
Hum... this is strange as I do not experience this bug in mobile safari (but I am on ios7). Adding a redirection method header is a good idea. But I really think the bug is elsewhere since I use vlad's lib for getting the browser value. See: https://github.com/DeuxHuitHuit/flang_redirection/blob/master/events/event.flang_redirect.php#L54 |
And yes you're totally right about how it works! |
Thanks for your feedback! I did some further investigation and noticed that my problem also appears on iOS7. The check for the browser languages seems to be done by the function There I noticed that on my Desktop-Browsers I get an array of languages that's looking like this:
But on mobile Safari I don't get
And the problem seems to be that this isn't recognized as the So the thing missing in this process is that the full locale-code is stripped down to my language code set in symphony. So that every I managed to get this working by changing lines 90-96 to the following:
By extracting the language bits of the complete locale-code I managed to get all different "flavors" of german fall back to Would be great If you could have a look at this and include it if it makes sense :) Thanks a lot! |
Wow! Awesome debugging-fu :) I'll see what I can do. |
I can confirm that your patch does solve the problem. Thanks again. Version 1.2 is out, just for you ! |
@twiro Did you had the chance to test it ? |
I implemented it a while ago and haven't had any more complaints since then - so I guess it's running just fine. Thanks again! |
Cool! I have deployed it myself and nobody complained! Thanks again. |
A client told me they had troubles with the default language on mobile safari - I just checked that and it seems not to work for me too.
My configuration seems fine, everything works as expected on Firefox, Chrome and Safari at my desktop - whenever I delete the page-cookies and access the base-url ('domain.org') without language code, the site gets redirected based on my default browser language (german) : 'domain.org/de/'
But mobile Safari ignores the default browser language when no language is preselected (cookies are deleted too) and always shows the page content in 'en' (which is my default language set in symphony).
This is a Screenshot of my Browser User Agent String:
Is this a bug or might there be a mistake on my side...?
By the way - it would be awesome if the detection method could be added to the readme - as far as I understand this is what's going on:
Am I right? Or am I missing something...?
The text was updated successfully, but these errors were encountered: