HTML
The objective of this technique is to clearly identify any changes in language on a page by using the lang attribute.
Allowed values for the lang attribute are indicated in the resources referenced below. Language tags use a primary code to indicate the language, and optional sub-codes (separated by hyphen characters) to indicate variants of the language. For instance, English is indicated with the primary code "en"; British English and American English can be distinguished by using "en-GB" and "en-US", respectively. Use of the primary code is important for this technique. Use of sub-codes is optional but may be helpful in certain circumstances.
lang attribute to define a quote written in German<blockquote lang="de">
<p>
Da dachte der Herr daran, ihn aus dem Futter zu schaffen,
aber der Esel merkte, daß kein guter Wind wehte, lief fort
und machte sich auf den Weg nach Bremen: dort, meinte er,
könnte er ja Stadtmusikant werden.
</p>
</blockquote>
For each element in the document:
lang and xml:lang attributes.
For each lang attribute in the document:
lang attribute conforms to BCP 47: Tags for Identifying Languages; Matching of Language Tags or its successor.