Revision 1090651 of Content-Language

  • Revision slug: Web/HTTP/Headers/Content-Language
  • Revision title: Content-Language
  • Revision id: 1090651
  • Created:
  • Creator: fscholz
  • Is current revision? No
  • Comment

Revision Content

{{HTTPSidebar}}

The Content-Language entity header is used to describe the language(s) intended for the audience, so that it allows a user to differentiate according to the users' own preferred language.

For example, if "Content-Language: de-DE" is set, it says that the document is intended for German language speakers (however, it doesn't indicate the document is written in German. For example, it might be written in English as part of a language course for German speakers).

If no Content-Language is specified, the default is that the content is intended for all language audiences. Multiple language tags are also possible, as well as applying the Content-Language header to various media types and not only to textual documents.

Header type {{Glossary("Entity header")}}
{{Glossary("Forbidden header name")}} no

Syntax

Content-Language: de-DE
Content-Language: en-US
Content-Language: de-DE, en-CA

Directives

language-tag
Multiple language tags are separated by comma. Each language tag is a sequence of one or more case-insensitive subtags, each separated by a hyphen character ("-", %x2D). In most cases, a language tag consists of a primary language subtag that identifies a broad family of related languages (e.g., "en" = English), which is optionally followed by a series of subtags that refine or narrow that language's range (e.g., "en-CA" = the variety of English as communicated in Canada).

Specifications

Specification Title
{{RFC("7231", "Content-Language", "3.1.3.2")}} Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content

Browser compatibility

{{Compat}}

See also

  • {{HTTPHeader("Accept-Language")}}

Revision Source

<div>{{HTTPSidebar}}</div>

<p>The <strong><code>Content-Language</code></strong> entity header is used to describe the language(s) intended for the audience, so that it allows a user to differentiate according to the users' own preferred language.</p>

<p>For example, if "<code>Content-Language: de-DE</code>" is set, it says that the document is intended for German language speakers (however, it doesn't indicate the document is written in German. For example, it might be written in English as part of a language course for German speakers).</p>

<p>If no <code>Content-Language</code> is specified, the default is that the content is intended for all language audiences. Multiple language tags are also possible, as well as applying the <code>Content-Language</code> header to various media types and not only to textual documents.</p>

<table class="properties">
 <tbody>
  <tr>
   <th scope="row">Header type</th>
   <td>{{Glossary("Entity header")}}</td>
  </tr>
  <tr>
   <th scope="row">{{Glossary("Forbidden header name")}}</th>
   <td>no</td>
  </tr>
 </tbody>
</table>

<h2 id="Syntax">Syntax</h2>

<pre class="syntaxbox">
Content-Language: de-DE
Content-Language: en-US
Content-Language: de-DE, en-CA
</pre>

<h2 id="Directives">Directives</h2>

<dl>
 <dt><code>language-tag</code></dt>
 <dd>Multiple language tags are separated by comma. Each language tag is a sequence of one or more case-insensitive subtags, each separated by a hyphen character ("-", %x2D). In most cases, a language tag consists of a primary language subtag that identifies a broad family of related languages (e.g., "en" = English), which is optionally followed by a series of subtags that refine or narrow that language's range (e.g., "en-CA" = the variety of English as communicated in Canada).</dd>
</dl>

<h2 id="Specifications">Specifications</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Title</th>
  </tr>
  <tr>
   <td>{{RFC("7231", "Content-Language", "3.1.3.2")}}</td>
   <td>Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content</td>
  </tr>
 </tbody>
</table>

<h2 id="Browser_compatibility">Browser compatibility</h2>

<p class="hidden">To contribute to this compatibility data, please write a pull request against this file: <a href="https://github.com/mdn/browser-compat-data/blob/master/http/headers.json">https://github.com/mdn/browser-compat-data/blob/master/http/headers.json</a>.</p>

<p>{{Compat}}</p>

<h2 id="See_also">See also</h2>

<ul>
 <li>{{HTTPHeader("Accept-Language")}}</li>
</ul>
Revert to this revision