Website language selection

Posted on 8 January 2013

0


If you want your website in different languages you can:

  1. use http://www.example.com/nl/ for the dutch site (like apple.com does). Redirect example.nl users to example.com/nl/
  2. use TLD’s: example.com for english and example.nl for dutch (like google does).
  3. use the html.en extension for Apache MultiViews language negotiation
  4. use a parameter like ?lang=en to serve out different languages on the same URL

Then the ways to direct people to the right place:

  1. use a ip address database to select the language system of the user based on geolocation
  2. use the language that is sent in the header from the browser
  3. use a selector on the upper right corner of the page to have the visitor choose for themselves

Sometimes your autoselector has it wrong, os make sure the user doesn’t have to go through the pain of changing it every time, by using a

  •  php session or cookies to let people store their preference (like google does).

There are a few things to consider:

  1. Are all pages available in all languages? Otherwise you will need to make up some system to redirect users to a holding page if they select another language, or add a google translate function (you can even do that in the .htaccess file).
  2. Are the pagenames the same in all languages, or will you have different urls based on different languages? I’m pretty sure it will be different in different languages.

Users also can have the google translate bar (built into chrome for example). This determines the text language by looking at the actual text, not the <html lang=””> tag of the page.

Conclusion

So I prefer to use TLD’s for the different language sites. Each with their own sitemap and layout. You could link these pages to each other in one CMS, for your own overview and for crosslinking.

I like the idea that if I end up on a landingpage and click on another language, that I get served the exact same page but then in my language of choice. This means that there has to be plan for pages that only need to exist in one language. This is also very important for google ranking. I don’t have that plan yet.

You might want to add a autoselect script for the .com domain, to direct local users to their language automatically. Just make sure they can go back to the .com if they have their browsers language set wrong by default. I made a script that doesn’t need any cookies, but yes: they will have to do this everytime they visit the .com domain.

Advertisements
Posted in: HTML