Jump to content

Help:bilingual Site Language Auto Detect And Direct


franceav
 Share

Recommended Posts

So I have a site which has 2 languages English and Chinese, how could I direct the front page according different user language, I think this could be done by using browser language detection and window.onload to direct but can't writethe actual code, please help and any useful sources are welcomed as well, thanks in advance!!

Link to comment
Share on other sites

Javascript is limited in what it can do with the language, something like this should work at least for IE:http://javascript.about.com/library/bllang.htmIt would be a better solution if you could use a server-side language like PHP which will have access to the headers that the browser sent, including the accept-language header.

Link to comment
Share on other sites

Javascript is limited in what it can do with the language, something like this should work at least for IE:http://javascript.about.com/library/bllang.htmIt would be a better solution if you could use a server-side language like PHP which will have access to the headers that the browser sent, including the accept-language header.
thanks, very helpful, I think to use php is easier and my pages are running in a php server, but still i don'tknow how to do with it, can you or someone give me some of the sample code for making this happen!
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...