Picto thématique

Rule n° 130 - The server respects the preferential order of languages specified by user agents.

Each request to a server may include information about language preferences. Each Internet user can classify his or her preferred languages in his or her browser. The server must offer the contents in the order requested by the user. If the user indicates French, then Spanish, then English, the server must serve the page in French if it exists, otherwise in Spanish if it exists, and otherwise in English if it exists.

#Internationalization #Development

Goal

  • Priority is given to sending the user the version of the page corresponding to the language he or she has indicated in the preferences the user agent tool.

Implementation

Use server-specific content negotiation, testing the accept-language HTTP header values.

Control

For a website available in several languages (French and English, for example):

  • Modify your browser options to choose your favourite language: select, for example, English as the preferred language;
  • Type the main URL of the website in this same browser and check that the contents of the page are available in the favourite language. In our example, the English version should be automatically returned.
  • Perform the same test by choosing another preferred language in the browser options.

By Opquast - Read the license