Open In App

HTTP headers | Content-Language

Improve
Improve
Like Article
Like
Save
Share
Report

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

Last Updated : 23 Oct, 2019
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads