I am designing a menu that gives users a choice of the language they would like the website displayed in - English, French, German and Welsh (and in the future possibly more).
Is there a standard way to do this that is both usable and accessible?
So far I am considering a simple list with the languages displayed like this: English | Francais | Deutsch | Cymraeg Or perhaps a collection of flags (might be dangerous ground!)
The main issue is that the list might end up quite long and I want to fit into the main navigation (think CSS Beauty top navigation with already 7+ links).
Any help/ideas is appreciated!Including any links to sites that currently do this or thoughts from people who use sites where they have to choose a language that is different to the site's natural language.
Google.com has a nice way of doing this without the flags or a long list of available languages. You could first figure out what country the user is coming from, and then display a link like "go to Google Finland" for example. Also, you might want to include a link for those coming from a specific country, but who don't actually speak the language - like Adobe's location link: "United states (change)".
Yeah, I agree with kari.patila's idea, this would probably be the easiest way to do it and cleanest way. Here is an about.com article on this topic: http://javascript.about.com/library/bllang.htm
the code (from the above link): var langcodes=["fr", "es"];
// Browser Language Redirect script // copyright 3rd January 2006, Stephen Chapman // permission to use this Javascript on your web page is granted // provided that all of the code in this script (with the sole exception // of the langcodes array entries) is used without any alteration
var langCode = navigator.language || navigator.browserLanguage; var lang = langCode.toLowerCase(); lang = lang.substr(0,2); var dest = window.location.href; for (i=langcodes.length-1;i >= 0; i--) { if (lang==langcodes[i]) { dest = dest.substr(0,dest.lastIndexOf('.')) + '-' + lang.substr(0,2) + dest.substr(dest.lastIndexOf('.')); window.location.replace ?window.location.replace(dest) :window.location=dest; } }
It's a nice idea to base where the user is to display which language is available. I like the idea of Adobe's location link too but I foresee the main problem will be Welsh. I would imagine a lot of users who want to read the site in Welsh will have the language of their browser set to English (although this might not be the case).
But as long as there is an option somewhere to change the language this shouldn't be too much of an issue.
When I said "first figure out which country the user is coming from", I meant to figure out the country, not the browser language setting. Do a Google search for ip-to-country.csv, or download the IP to Country - class from phpclasses.org.