Techniques for multilingual Web sites:
Language negotiation in the protocol

The language negotation mechanism is based on the following ideas:

At the level of the HTTP protocol, the browser sends an Accept-Language header which lists the acceptable languages and their relative acceptabilities. More exactly, it lists the languages so that a language indicator (code) can be followed by a quality value, which is a number between 0 and 1, specifying the relative acceptability. For example, the header
Accept-Language: fi;q=1, en;q=0.2
would say that both Finnish (fi) and English (en) are acceptable, but Finnish is much more acceptable. (This does not necessarily imply that the server always sends a Finnish version, if it is available; a server could also consider the relative "goodness" of the versions.) The notation is a bit strange, since in it, comma is a stronger separator than semicolon; additional confusion can be caused by the rather common way of leaving a space after the semicolons.

The mechanism discussed here is the so-called server-driven negotation. The protocol defies other negotiation mechanisms too, but it seems that their practical significance is still small.

There is some more information about language negotiation at the W3C site, in section Internationalization, subsection HTTP. There is a much more illustrative description, though from the perspective of one server software only, in the Apache Week article Content Negotiation Explained.

Quite often page authors try to perform language selection on the basis of the user's Internet address, more exactly its top level domain. This is largely just guesswork. For example, not everyone in the .fi domain (or, more properly, using a computer which is in the .fi domain) speaks Finnish as his native language, or at all. And Finns may use other addresses than .fi addresses. But if you still try to make a language selection guess according to the user's domain, remember that the guess will quite often be wrong, so it is necessary to make available links through which the user can find a page in his preferred language.

Next section: Language negotiation and settings in a server (with Apache as example).


2002-01-01 Jukka Korpela