Table of Content
The Content-Language header indicates the natural language(s) of the intended audience for the document. This allows users to specify languages in preference order for HTTP request messages. For HTTP responses, if no Content-Language is specified, the default is that the content is intended for all language audiences. This can be overridden by user agent settings.
The syntax structure for the header can be displayed in the following format:
Your language directive will replace the “language” mentioned in the syntax.
The directives for the Content-Language header could consist of a single language tag or multiple language tags.
The language tags should conform to BCP 47. They can include primary language tags, subtags and region tags as necessary.
For example, "en" stands for English, while "en-US" stands for English as used in the United States.
Here are some examples of usage of the Content-Language header:
This indicates that the server intends to return a response document in French.
Content-Language: en, fr
This example indicates that the intended audience for the document is capable of understanding English and French at the same time.
How to modify Content-Language header
ModHeader is a Chrome extension that allows you to modify headers on-the-fly to test servers, pages, and verificarion of HTTP headers and response data. To configure the Content-Language header with ModHeader, follow these steps:
- Install the ModHeader browser extension.
- Click on the ModHeader icon in the toolbar.
- In the dropdown, click on ‘Add'.
- Enter 'Content-Language' in the ‘Response header’ field.
- Enter the language tag (e.g., 'en') in the 'Value' field.
- Save the settings.
With this setup, ModHeader replaces the Content-Language header in your request with the value you specified, enabling you to test the behavior of the server or page with different language settings.