Closed (works as designed)
Project:
Drupal core
Version:
7.14
Component:
language system
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
4 Jun 2012 at 10:26 UTC
Updated:
14 Sep 2012 at 10:46 UTC
I am setting up my interface language detection as such:
When anonymous users access the website, the interface is shown in the sites default language regardless of their browser setting. Is there a way to fix this?
There is indeed 2 separate caches for example.com/ and example.com/?language=ja, but we just need to have the users be redirected to the correct path. Perhaps we can write a redirect script in hook_boot() for anonymous users without a $_GET['language'] variable set? But then again $language is not accessible in hook_boot()..
Comments
Comment #1
fenda commentedSo it turns out browser detection is skipped by design for anonymous users with page cache enabled. I implemented the following to work around this:
Comment #2
kspal commentedWhere did you put this code? Did you create a specific module to do so?
Comment #3
fenda commentedI put it in my custom module. My custom module had a weight in the system table of -1, not sure if that helped. :)
Comment #4
facal commentedThank you!
I would also suggest this http://drupal.org/node/339958#comment-2503184 which seems to me an alternative solution (for Apache only).
drupaljoe, please correct me if I misunderstood