| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| DesignersTalk > What's the BEST way to detect the browser language? |
|
LinkBack | Thread Tools | Search this Thread |
|
|
#1 (permalink) |
|
Registered User
Join Date: Jan 2008
Location: Hamburg, Germany
Posts: 27
|
Hi, I have a website in two languages, English and German: How can I make sure that each visitor is sent to the correct language version? I've been doing quite a bit of searching but can't decide between a javascript or php based solution. I need a script that detects the user's browser language and then immediately renders the website in his/her language. However, the user should also be given the opportunity to switch to the other language should s/he wish to. Any ideas on how to implement this? |
|
|
|
|
|
#4 (permalink) |
|
Everything is fine.
|
For this situation I would try to avoid a JavaScript solution as this can easily be disabled thereby rendering your language detection obsolete. Using a server-side solution you should always get the result you require; a more reliable method. - Mike |
|
|
|
#5 (permalink) |
|
Grumpy old man
Join Date: Oct 2007
Location: North Japan
Posts: 1,465
|
This is one of my pet hates. When you're an expat using Japanese Windows, it's an absolute pain in the ass to keep switching to English - you'd be amazed how many sites auto-detect language these days. It's one of the main reasons I use a Mac, because the language setting is switchable between accounts - my wife can have everything in Japanese and I can use English. Now, that said, it's a completely sensible thing to do, because it does provide a service for the vast majority, and only inconveniences a tiny minority of people. But as a member of that tiny minority, can I plead with you to bear in mind the following: 1. make it ABSOLUTELY BLOODY CLEAR, where to change the language settings. There's nothing worse than having to hunt through half the site trying to find out how to switch it to your language of choice, because the designer buried it somewhere. If I'm only there for a quick visit, I'll use Japanese because sometimes it's not worth the hassle of switching, but a lot of my web surfing is for relaxation or my own personal interests, and I'd like to be able to do that in my native language where possible. 2. Set a cookie with a long expiration time to remember the language settings. It's really annoying when you go back to a site regularly and have to switch the language every single time you use it. |
|
|
|
#8 (permalink) | |
|
Registered User
Join Date: Jan 2008
Location: Hamburg, Germany
Posts: 27
|
Quote:
Hi Hunch, This is exactly what I'm planning to do. I have myself lived abroad for a few years, so I know EXACTLY what you're talking about here. On all of my pages there will be a language switch button in the upper right corner, so users can select another language at any time. I think this is indeed very important from a usability point of view. Nonetheless, the first time somebody visits my site, it should appear in the respective system language and not some generic default language, that is, when the user has "German" as his system language, the site should appear in German, in all other instances it should appear in English. How can I do this? Would you reckon that a PHP-based solution is best? Thanks for any input in this matter... Cheers. |
|
|
![]() |