Sun Java System Web Server 6.1 SP12 Administrator's Guide

Configuring the Server to Serve Localized Content

End users can configure their browsers to send an Accept-language header that describes their language preference for the content they are accessing. The server can be configured to serve content based on the Accept-language header by turning the acceptlanguage setting on for the VS class in the Edit Classes menu of the Administration Server. This also ensures that all end user error messages are also based on the Accept-language header.

For example, if acceptlanguage is set to on, and a client sends the Accept-language header with the value fr-CH,de, when requesting the following URL:

Your server searches for the file in the following order:

  1. The Accept-language list fr-CH,de.

  2. Language codes without the country codes (fr in the case of fr-CH):

  3. The DefaultLanguage, such as en, defined in the magnus.conf file.

  4. If none of these are found, the server tries:

    Note –

    Keep in mind when naming your localized files that country codes like CH and TW are converted to lower case and dashes (-) are converted to underscores (_).

    Caution – Caution –

    Enabling the acceptlanguage setting has a performance penalty since the server has to check for content in every language specified in the Accept-language as per the algorithm illustrated above.