Iphone uiaccessiblity multiple languages

I read about VoiceOver on the iPhone, but I can't find anyone talking about how to mark content as a specific language and use more than one language in an application. I want to make my VoiceOver dictionary compatible.

For example, you can write this in a UITableViewCell (English, then German), and VoiceOver will read this line with two different voices:

drink - trinken

If this is not possible, VoiceOver users cannot use content that has more than one language at a time.

+4
source share
1 answer

Apple has defined a protocol, see here , called UIAccessibility , which is implemented by all views in UIKit . The protocol defines the accessibilityLanguage property, which sets the language of the element. By default, nil returned, which is interpreted as the default user language.

As for the individual representations, it seems impossible to simultaneously choose two different languages. However, it seems possible to declare two separate representations (one with English, the other with a German label) and override the above method for both representations, returning different languages ​​for both. This way you can effectively use two different languages ​​with VoiceOver in your application.

+3
source

All Articles