Mobile Accessibility Guidelines - Editorial
Indicating language must
The language of a page or app must be specified, and changes in language must be indicated.
When listening, correct pronunciation helps understanding. For users of assistive technologies such as screen readers it is particularly important, as some have different speech synthesizers for different languages. For example, 鈥渃hat鈥 means something different when using English pronunciation rather than French.
The default language for the content of a page or app must be defined in the code for the correct speech synthesizer to be used. It will over-ride any language and dialect setting specified on the users device.
For multi-lingual content, the language for anything that varies from the default language must also be defined in the local code for the correct speech synthesizer to be used. This includes image alternatives, form labels, quotes, objects, media alternatives, and other elements. It will over-ride the specified default language and any language and dialect setting specified on the users device.
iOS
By default, VoiceOver will announce content within the application in whichever language a user uses for VoiceOver. Consequently, if the application is in a different language, VoiceOver may not pronounce the content correctly. To resolve this, make sure that the correct language of the application is set through the accessibilityLanguage attribute so that the resultant content is pronounced as it should be.
If your application supports multiple languages, it is important to localize the content. Refer to for more details.
iOS Example (Objective-C)
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[application setAccessibilityLanguage = @"en-EN"]; //
This will set the default language to English. Other options include "de" for German, "fr" for French, "es" for Spanish and so on.
return true
}
Android
Initial investigations suggest it is not possible to programmatically change TalkBack鈥檚 language, therefore, TalkBack will read all content based upon the user鈥檚 default language settings. This technique will be updated if and when more information comes to light.
HTML
Apply the lang
attribute to the html
element to specify the language of the page. Additionally, use this attribute to indicate changes in language on a page.
HTML Pass Example
<!-- HTML -->
<html lang="en">
...
<!-- XHTML -->
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
鈥
<p>Language options:</p>
<ul>
<li><a href="鈥">English</a></li>
<li><a href="鈥"><span lang="es">Espa帽ol</span></a></li>
</ul>
Testing
Procedures
- Set the platform language.
- Activate the app with platform standard assistive technologies enabled.
- Verify the following appears or are announced in the correct language:
- Text,
- Text in a different language from that of app/site,
- Images of text,
- Images of text in a different language from that of app/site,
- Labels,
- Tooltips,
- Sounds,
- Video sub-titles,
- Page and screen titles,
- Alternatives for image, objects and elements in a different language from that of app/site.
Outcome
The following check is true:
- All content, text, images of text, audio, video subtitles, and alternatives are announced or displayed in the language expected, as set in iOS;
- The language should switch appropriately.