Made of Everything You're Not

Writing code... well, forever really. Sigh...
  • Home
  • Projects
  • Portfolio
  • Resume
« Facebook Connect Primer
iTunes Data WordPress Widget »

Language Select Screens Die!

One of the things I’ve done way too much of is the creation of language select pages. These are the types of pages on a website that visitors first encounter asking them to pick their language and they are a pain in the ass.

Weirdly, it’s a trend to have language select pages that contain a country flag. There’s a pretty strong arguments against this approach though, which makes a lot of sense considering there is no real correlation between country and language. It seems to me that any country with any amount of immigration knows this is true.

Dunce

Dunce

Now, I may not like language select pages as a web developer, which I’ll go into more detail on in a minute, but I reeeaaaallllllly hate them when I visit a website that uses them. No matter what link I go to, whether I go directly to a page from a search engine or a bookmark, unless I’ve been through their language page I get forced to deal with it.

That’s just jarring and a little rude to me. I have the link. Just show me the stuff already!

Anyway, this begs the question, “WTF?” because nine times out of ten the website already knows what language I want pages served in.

Why It’s Stupid…

See, all modern browsers send this data along with every page request but, as evidenced by the proliferation of language select pages, web developers have yet to take advantage of that info.

In FireFox 3 go to Tools->Options->Content->Languages

FireFox3 Language Select

FireFox3 Language Select

In IE 7 go to Tools->Internet Options->Languages

IE 7 Language Select

IE 7 Language Select

In Google Chrome click on the little wrench icon in the upper right hand corner and select Options from the drop down. Select Minor Tweaks and choose Change fonts and language settings.

Chrome Lang Select Page

Chrome Lang Select Page

In php you can access this info using the below variable.

<?php 
echo $_SERVER['HTTP_ACCEPT_LANGUAGE']; 
?>

In ASP.NEW you use the below:

<% Response.Write(Request.ServerVariables("HTTP_ACCEPT_LANGUAGE")) %>

In PERL the below does it:

print $ENV{'HTTP_ACCEPT_LANGUAGE'};

On my computer using FireFox 3 this is the value:

 en-us,en;q=0.5

So right there it’s saying I’m in the US and I prefer English as my language. It’s trivial for any programmer worth their salt to parse that into something usable. Use that as my preference instead of wasting my time by making me click on a stupid flag.

Bookmark and Share

Tags: language select

This entry was written by Eric Lamb and posted on Friday, March 13th, 2009 at 5:38 am and is filed under Code, Programming, Rant. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

One Comment

  1. hydraulic car jack says:
    March 14, 2009 at 4:23 am

    It’s the first time I commented here and I must say you provide genuine, and quality information for bloggers! Good job.
    p.s. You have an awesome template . Where did you find it?

    Reply

Leave a Reply

Click here to cancel reply.

  • Subscribe: Entries | Comments
  • About Me

    Email Email
    Twitter Twitter
    310.739.3322
  • Categories

    • Brain Dump
    • Business
    • Code
    • IT
    • Programming
    • Rant
    • Servers
  • Archives

    • October 2011
    • August 2011
    • July 2011
    • June 2011
    • May 2011
    • April 2011
    • March 2011
    • February 2011
    • January 2011
    • December 2010
    • November 2010
    • October 2010
    • September 2010
    • August 2010
    • July 2010
    • June 2010
    • May 2010
    • April 2010
    • March 2010
    • February 2010
    • January 2010
    • December 2009
    • November 2009
    • October 2009
    • September 2009
    • August 2009
    • July 2009
    • June 2009
    • May 2009
    • April 2009
    • March 2009
    • February 2009
    • January 2009
    • December 2008
    • November 2008
    • October 2008

Copyright © 2008 - 2012 Eric Lamb - All rights reserved