HTTP headers | Content-Language

HTTP headers are used to provide additional information in HTTP request and HTTP response. HTTP headers Content-Language is used to define, which language speaker document is intended to. It doesn’t define the language of the document. In case this header is not specified, it is assumed that the document is intended for all language speakers.

Syntax:

  • When only one language is specified
    Content-Language: <language-tag>
    
  • When multiple languages are specified
    Content-Language: <language-tag>, <language-tag>, <language-tag>
    

Directive:

  • language-tag: It is the case-insensitive directive which defines the language. Generally, it consists of two parts. First part defines the primary language which defines a broad family of related languages (e.g., “en” = English) and the optional second part which is separated by “-” and used to narrow the language range.

Example:

  • It says that English speakers are the intended audience of the page.
    Content-Language: en
  • It says that German and English speakers are the intended audience of the page.
    Content-Language: de, en

To check the Content-language in action go to Inspect Element -> Network check the request header for content-language like below.

Supported Browsers: The browsers compatible with HTTP headers Content-language are listed below:

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Safari
  • Opera
My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.