Future Media Standards & Guidelines

Indicating language

The main language of the page must be specified.

Changes to language within the page must be indicated.

Rationale

Assistive technologies such as screen readers have support for different languages, allowing for appropriate pronunciation.

Techniques

Pass:

<!DOCTYPE html>
<html lang="en-GB">
<head>
    <title>Language techniques</title>
</head>
<body>
    <h1>Techniques for language in HTML</h1>
    <p><span lang="es">Cinco de Mayo</span> is Spanish for "fifth of May"</p>
</body>
</html>

Fail:

<!DOCTYPE html>
<html>
<head>
    <title>Language techniques</title>
</head>
<body>
    <h1>Techniques for language in HTML</h1>
    <p>Cinco de Mayo is Spanish for "fifth of May"</p>
</body>
</html>

Tests

Procedure Expected Result Type
Search source for <html> element <html> element must have a lang attribute with a value equal to the language code for the main page content language Manual
Validate the page against the W3C Internationalization Checker There must not be a ‘The html tag has no language attribute’ warning, and the Language HTML tag value should match the language code for the main page content language Tool
Search source for each instance of a language change Each instance should have a containing element with a lang attribute with a value equal to the language code for the language Manual

Using the standards and guidelines

You can use use and re-use the the BBC Accessibility Standards and Guidelines under an Open Government Licence for Public Sector Information.

Details can be found on the Open Government Licence for Public Sector Information website.

Feedback

We would love to hear your feedback. If you have a question or comment about the standards or guidelines email us at AccessibilityTeam@bbc.co.uk.

BBC © 2014 The BBC is not responsible for the content of external sites. Read more.

This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.