views:

269

answers:

1

Hi, all!

I have a multi-language drupal setup (2 languages, english default). I want users to receive always content in the other language (lets say spanish) on initial page request, but keep english as default language for future language switch. So users will be redirected on initial load to site.com/es, but through the language switch will be able to go to site.com/ (which is english).

Any suggestions? Thank you.

(Apache, PHP)

+1  A: 
Nikit
well, i thought about it. the problem is that it has to run only once as the user loads the page initially. what will happen at a consecutive return to home?
spk
now to run only once means that the state of the anonymous user has to be defined implicitly at beginning and end. beginning like you point out correctly is quite neatly taken care of with the aforementioned snippet, but end, mmm... none of the ajaxian-postmethod-php that come to my mind are worth sharing as they appear all elaborate hacks to me. funny things is the net nowadays.
spk

related questions