Damien Vaillant
.com
💼 E-learning solopreneur 🧭 in Avignon, FR 📅 since 2020

Respecting users’ language preferences

At the beginning of 2020, in the midst of a global pandemic, I moved to France for what would turn out to be far longer than I anticipated at the time.

Having lived in different countries for the past 15 years, I had grown used to browsing the Internet in non-English-speaking countries which would often require manually setting my language preferences.

Going back to Europe, I expected this to be less of a problem given that English is used as the de-facto language of the European Union, but to my surprise, the situation here turned out to be on par or sometimes even worse than in countries like Thailand, and China.

Most companies, including well established ones like Amazon, will automatically set your language based on your location and won’t provide an alternative language to use. The vast majority of websites which happily offer an English version of their page to anyone in the world, seemingly bar French residents from seeing their pages in English.

Even Google, Youtube, and Reddit who DO support setting English as the default language will continue to show you French content even after setting your language to English and your location to an English-speaking country, forcing users to use VPNs as the last resort. These companies will simply go out of their way to ignore your preferences and make the experience worse for you.

After researching the issue for a bit and reading thousands of similar complaints from users across Europe and even the world at large, I came across this great post by Pedro Pimenta that perfectly describes the problem.

While I don’t have a solution to the problem for end users, there is a pretty simple solution for website developers: the standard navigator.language property reveals your users’ language preference as they set them in their web browser:

var userLang = navigator.language || navigator.userLanguage;
JavaScript

This is a far better predictor of a user’s language that their physical location.

So if your website serves content in multiple languages be sure to use native the navigator.language property to respect your users and their languages preferences and make the web a better place.

Site credits