Unable to switch language with language negotiation enabled on 5.1.x, 5.2.x

4 views
Skip to first unread message

Alexander Obuhovich

unread,
Sep 26, 2012, 8:07:06 AM9/26/12
to Bugs In-Portal
In-Portal has a feature (disabled by default), which allows automatically change website language to one, that matches language from "Accept-Language" header, sent by user's browser on first visit.

This way, when user opens http://www.website.tld/ (website on primary language, since no language in url) he is automatically redirected to http://www.website.tld/user-language/index.html.

There is only one major problem: first visit detection. We presume, that first visit is when no page has been specified = home page.
Since home page url is / instead of /index.html users is redirected to http://www.website.tld/user-language/index.html each time he wants to change language back to primary website language while staying on home page.

I think we should remember user's first visit in cookie, that would expire when browser window is closed instead of looking if page in url wasn't specified (only domain is specified).

--
Best Regards,

http://www.in-portal.com
http://www.alex-time.com

Alexander Obuhovich

unread,
Sep 27, 2012, 6:40:35 AM9/27/12
to Bugs In-Portal
Maybe cookie is simple idea, but it will be sent back and forth on each website page access.

To solve this checking referrer maybe is better option. If user is coming from outside (no matter if he has page in url or not) redirect him to his language and keep existing page.

Dmitry A.

unread,
Oct 24, 2012, 2:24:31 AM10/24/12
to in-port...@googlegroups.com
Hi Alex,


Yes, it should be checked with Referrer - if it's not our website (including empty) it means it's a new visit in most cases.

Also, we might want to use Cookie to set as we already visited the website and Language that been selected or similar idea. I have seen this on other websites not with Language but other things that are checked.


DA

Alexander Obuhovich

unread,
Nov 5, 2012, 12:02:33 PM11/5/12
to Bugs In-Portal
Task: http://tracker.in-portal.org/view.php?id=1432


--
You received this message because you are subscribed to the Google Groups "In-Portal Bugs Team" group.
To view this discussion on the web visit https://groups.google.com/d/msg/in-portal-bugs/-/qBb8zKCBj8wJ.
To post to this group, send email to in-port...@googlegroups.com.
To unsubscribe from this group, send email to in-portal-bug...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/in-portal-bugs?hl=en.
Reply all
Reply to author
Forward
0 new messages