Web-development anti-pattern: Compulsory Internationalization

Blogger really takes internationalization seriously. They even have a Croatian translation of their site interface -- when I tried to comment on a post earlier today I was told things like "Postoje izmjene koje nisu spremijene." Very thorough job, it seems. Similarly, when I type www.google.com in my address bar, I arrive at www.google.hr , where I can search "Web", "Slike", "Grupe", or "Imenik".

The problem is, I do not speak Croatian.

To make internationalization work, browsers send an Accept-Language header with every request. This header lists one or more languages that are considered 'acceptable' by the client, and the server can use this information to determine in what language it should respond. Alternatively, it could ignore the header if it only knows one language.

My browser is sending Accept-Language headers telling all webservers that I would like the pages sent to me to be in English. However, at the moment I am in Zagreb, so my IP will resolve to something ending in .hr (Hrvatska). Apparently, Blogger and Google are ignoring the header, and using the IP.

To point out the obvious: Just because someone happens to be connecting from a certain country does not mean he or she speaks that country's language. It puzzles and annoys me that these sites do not just use the Accept-Language header, which has been invented for precisely this purpose.

If you are aware of some good reason for using this bizarre approach to internationalization, kindly e-mail me and explain, or leave a comment at reddit.

Michael Stevens suggests:

I don't know why google do this, but I have a guess I think is very likely. Accept-Language depends on the user's browser being correctly configured to send the appropriate header. I suspect most browsers are not correctly configured, and google have found that guessing based on country gives the correct language interface for a higher percentage of users than the more technically correct approach.

... which might be the case, at least historically. However, I know that current versions of Firefox and Internet Explorer, when run on Windows, use the system's language setting to adjust their Accept-Language header, and I suspect that other modern browsers do the same. OS X probably has a similar feature, and I've even seen it on Linux machines in Internet-cafes. I'm not sure how big the group of people is that have their operating system configured to a language they do not speak.

Author: Marijn Haverbeke

Last updated: October 15th 2007

