lang attribute tests

This page is designed to test user agent support (specifically screen readers) for language switching in multi-language documents. The document has a lang attribute value of "en" included in the html element. Paragraphs under the French and and Spanish headings below are assigned lang attribute values of "fr" and "es" respectively. All references to HTML elements regardless of the language of their parent element include a lang attribute value of "en". The text used in this test is originally from Declaring language in HTML and tranlated using a software translation service.

English text, no lang specified

Always use a language attribute on the html element. This is inherited by all other elements, and so will set a default language for the text in the document head element.

Note that you should use the html element rather than the body element, since the body element doesn't cover the text in the document header.

If you have any content on the page that is in a different language from that declared in the html element, use language attributes on elements surrounding that content. This allows you to style or process it differently.

French text, lang attribute specified on p elements

Toujours utiliser un attribut de langue sur l'élément html. Ceci est héritée par tous les autres éléments, et ne sera donc définir une langue par défaut du texte dans l'élément de head de document.

Notez que vous devez utiliser l'élément html plutôt que l'élément body, puisque l'élément body ne couvre pas le texte dans l'en-tête du document.

Si vous avez n'importe quel contenu sur la page qui est dans une langue différente de celle déclarée dans l'élément html, utiliser des attributs linguistiques sur les éléments entourant ce contenu. Cela vous permet de style ou le traiter différemment.

Spanish text, lang attribute specified on p elements

Utilice siempre un atributo de idioma en el elemento html. Esta es heredado por todos los demás elementos, por lo que se establecerá un idioma predeterminado para el texto en el elemento head del documento.

Tenga en cuenta que debe utilizar el elemento html en lugar del elemento body, ya que el elemento body no cubre el texto en la cabecera del documento.

Si usted tiene cualquier contenido de la página que está en un idioma diferente del declarado en el elemento html, utilice atributos de idioma en los elementos que rodean ese contenido. Esto le permite a estilo o procesar de manera diferente.