Techniques for WCAG 2.0

Skip to Content (Press Enter)

-

FLASH13: Using HTML language attributes to specify language in Flash content

Important Information about Techniques

See Understanding Techniques for WCAG Success Criteria for important information about the usage of these informative techniques and how they relate to the normative WCAG 2.0 success criteria. The Applicability section explains the scope of the technique, and the presence of techniques for a specific technology does not imply that the technology can be used in all situations to create content that meets WCAG 2.0.

Applicability

This technique relates to:

User Agent and Assistive Technology Support Notes

See User Agent Support Notes for FLASH13. Also see Flash Technology Notes.

Description

The objective of this technique is to identify the default language of the Flash content by providing the lang and/or xml:lang attribute on the HTML or object elements for the page containing the Flash. The embedded Flash content will inherit the language specified. If the entire web page uses the same language, the lang and/or xml:lang attribute can be placed on the page's HTML element, as described in H57: Using language attributes on the html element.

Since Flash inherits the language from the HTML or object element, all text within the Flash content is expected to be in that inherited language. This means that it is possible to have a Flash object in the French language on a page that is primarily in another language, or to have a page with multiple Flash objects, each in a different language. It is not possible, however, to indicate changes in the human language of content within a single Flash object using this technique.

Examples

Example 1: Using the language of the page as whole in the embedded Flash

This example defined the content of the entire web page to be in the French language. The Flash content will inherit the specified language from the HTML container.

Example Code:

<?xml version="1.0" encoding="UTF-8"?>
<html lang="fr" xml:lang="fr" xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta content="text/html; charset=iso-8859-1"
      http-equiv="Content-Type"/>
    <title>Flash Languages Examples - French</title>
    <script src="swfobject.js" type="text/javascript"/>
    <script type="text/javascript">
    swfobject.registerObject("myMovie", "9.0.115", "expressInstall.swf");
</script>
  </head>
  <body>
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
      height="420" id="myMovie" width="780">
      <param name="movie" value="myMovie.swf"/>
      <!--[if !IE]>-->
      <object data="languages.swf" height="420"
        type="application/x-shockwave-flash" width="780">
        <!--<![endif]-->
        <!--[if !IE]>-->
      </object>
      <!--<![endif]-->
    </object>
  </body>
</html>

This is demonstrated in the working example of Using the language of the page as whole in the embedded Flash. The source of Using the language of the page as whole in the embedded Flash is available.

Example 2: Applying a language just to the embedded Flash

This example defines the content of a Flash movie to be in the French language. The Flash movie is embedded using SWFObject's static publishing method. This means that there are two nested object elements, the outer to target Internet Explorer, the Inner to target other browsers. For this reason the lang and xml:lang attributes must be added twice.

Example Code:

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
  height="420" id="myMovie" lang="fr" width="780" xml:lang="fr">
  <param name="movie" value="myMovie.swf"/>
  <!--[if !IE]>-->
  <object data="languages.swf" height="420" lang="fr"
    type="application/x-shockwave-flash" width="780" xml:lang="fr">
    <!--<![endif]-->
    <!--[if !IE]>-->
  </object>
  <!--<![endif]-->
</object>

Resources

Resources are for information purposes only, no endorsement implied.

Tests

Procedure

  1. Examine the html element and the object element of the HTML document containing the reference to the SWF.

  2. Check that the human language of the Flash content is the same as the inherited language for the object element as specified in HTML 4.01, Inheritance of language codes

  3. Check that the value of the lang attribute conforms to BCP 47: Tags for the Identification of Languages or its successor and reflects the primary language used by the Flash content.

  4. Check that no changes in human language occur within the Flash content

Expected Results

If this is a sufficient technique for a success criterion, failing this test procedure does not necessarily mean that the success criterion has not been satisfied in some other way, only that this technique has not been successfully implemented and can not be used to claim conformance.