Swiftui accessibility support non-ASCII words

I'm trying to implement an app in Hebrew language using SwiftUI, for some reason, the accessibility labels are not reading on voice over labels in Hebrew like for example:

Text("שלום") .accessibility(label: Text("שלום"))

Assistive technologies, such as VoiceOver, use speech synthesizers that are tuned for specific language code. In SwiftUI, the language code is derived from the locale of the views environment. But default the locale will be whatever the user has set in their settings.

So if you are displaying Hebrew in an English localized app, you'll probably need to set the locale to Hebrew on the view.

Text("שלום").environment(\.locale, Locale(identifier: "he_IL"))

Note that you dont need the accessibilityLabel modifier, the label will be the text contents by default.

Swiftui accessibility support non-ASCII words
 
 
Q