Ik spreek geen Nederlands
In this episode of the daily report about war crimes commited during web development we are going to take a slightly longer journey. Our task is straightforward: we are going to travel all around the world visiting a randomly* chosen website. Normally this would be time consuming and expensive, but thanks to the advanced breakthrough technology called "Virtual Private Network" that I managed to acquire, we can do it without leaving our living room sofas.
During our journey we will be using google.com
as an example of a commonly visited website. As a matter of simplification we will visit only two countries. Below you can see the appearance of the said website's front page as accessed from Belgium and Portugal, respectively. I haven't changed anything about my computing environment apart from moving it around Europe.
As you can see, the text was helpfully translated into the language of the country we happen to be in. Unfortunately I don't speak either Dutch or Portuguese so I can only interpret this behaviour as a punishment encountered by people rude enough to dare travel abroad without learning the language spoken in the country they happen to be in.
During this entire adventure my browser was happily sending the same information it always sends, dutifully informing the interested parties about my preferred language in which I like to consume popup windows, ads, be tracked and so on:
Accept-Language: en-US,en;q=0.5
It even seems like matching against a simple map of languages would be easier than using a library mapping IP addresses to countries**. I don't know what happens in the countries that use multiple languages by the way.
Unfortunately the problem I am describing is quite complex. The Accept-Language
header doesn't let the users express some complex requirements, such as a preference towards a language only if it is used in the country of origin of a website. A possible good compromise could be a preference towards the languages of the country the person is in, but only if they are present in the list of languages provided by the Accept-Language
header. This could help avoid serving inferior translations of a website to visitors but would not help VPN users. All joking aside though, what I imagine is the real reason behind this behaviour, is that many users have their Accept-Language
headers misconfigured. In my view, this is a failing of web browsers or operating systems and their user interface, maybe this could be solved by improving how hard it is to configure the desired language? You could even ask the user if they want to change the preferred language based on their IP address in software instead of having websites decide.
All things considered for now I believe that the Accept-Language
header is the best mechanism we have for solving those problems though.