Language

Based on an incomming request for a web page, you may want to present your the most appropiate content based on the language of the visitor. There are several ways of determining the language to use. It may even be a combination of the shown methods.

This is my preferred ordered to detect the language. From top to bottom. But your order may change. Also when one method is found, it may be promoted into another method. ie. when language parameter comes in it may set a cookie.

  1. parameter selection

    A locally selected argument to pick an exact language. Based on a user specified parameter.

  2. stash selection

    A locally selected argument to pick an exact language. Based on a user specified parameter.

  3. login based session value selection

    A locally selected argument to pick an exact language.

  4. session value selection (not login based)

    A locally selected argument to pick an exact language.

  5. cookie based selection

    A locally selected argument to pick an exact language.

  6. Accept-Language: header

    This is a prioritized list of languages. Select the first languages that is available on the server. Note that language is either <language>-<country> (f.ex. "en-us") or <language> (f.ex. "en")

  7. IP geo language

    The IP addres may indicate a country (trough use of a GeoIP lookup table), and thereby possibly one or more languages. But this cannot be trusted. So always allow the user to pick another language, in one of the above ways, before falling back to this.

  8. Generic fallback.

    The most used language(s) on the site.