Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I've done a simple, small site which basically only consists of a single page. Simplicity and no clutter are very intentional here and (imho) work quite well for this from a UX standpoint.

Now I'm thinking of translating what little content there is in different languages. To stick with the no clutter rule I thought about doing this only with content negotiation without even having different URIs for different languages. For the user that probably works best as they get their language without needing to configure anything but their browser, but I worry about search engines. I guess it's not likely that Google, Bing, etc. crawl a site with various different language preferences, meaning that the translated content won't get picked up by them and thus not appear in regional search results.

So do I have to include links for different languages on the page or is there another way for this?

share|improve this question
add comment

2 Answers

up vote 3 down vote accepted

An XML sitemap will show them where to find the alternative language pages. You can also put links in the footer of your pages linking to other languages. This is good usability as it allows people to easily find the language of their choice if they accidentally ended up on the page in a less-preferred language.

share|improve this answer
    
Well, my intention was to not give different URIs to different languages, as noted in the question. As for less-preferred languages: That might be true of technical people like us but I guess the average age of the site visitor is around 15 or so. –  Joey Jul 12 '11 at 22:23
    
You can do this without permanent different URLs. You can use a query string to pass the parameter to choose the language and then set a cookie with that preference and do a 303 redirect back to the same page. –  John Conde Jul 12 '11 at 23:29
    
I've solved this by now with using explicit URIs that contain the language to select, so /de is the German version, /pt Portuguese, etc. This may be contrary to my initial goals but I didn't trust Google to keep different language versions for the exact same URI. Content negotiation is still done when visiting /, though. The query string was used for something else already and while the two uses wouldn't contradict each other I was too lazy to work around that :-) –  Joey Sep 6 '11 at 7:20
add comment

An alternative to browser locale (which may not be reliable from a BOT) you can use Geo-IP (as a module on your Apache webserver or with PHP). The Geo-IP option may also make more sense if you have a product to sell.

In your index.php for php module version of GeoIP:

include("geoip/geoip.inc");
$gi = geoip_open("location/to/geoip/GeoIP.dat",GEOIP_STANDARD);
$country=geoip_country_code_by_addr($gi, $_SERVER['REMOTE_ADDR']);
geoip_close($gi);

If you want to use the Apache module:

$country=$_SERVER['GEOIP_COUNTRY_CODE'];

Thereafter you can put together a big 'if' or 'case' construct in your index.php to work with whatever code you have to render your page.

share|improve this answer
    
The site is static HTML with no server-side scripting language whatsoever. And selecting language based on location is something I will never, never do. It's nothing the user can control and you have too many cases where it fails. E.g. I'm in Germany and prefer English (and have stated so in my browser preferences). What do you do with people in Switzerland? German, French, Italian? People using TOR also will have the problem that they get languages assigned they can't control. –  Joey Sep 6 '11 at 7:17
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.