2

My phone is set to en_us as system language, and I have added Swedish and French to the VoiceOver rotor languages.

After adding the languages I find that the VoiceOver/Safari combo automatically starts in the appropriate language when browsing web pages where the document contains a language setting.

After examining various non-English AppStore apps that I have installed, one of them triggers an automatic language change in the screen reader when I open it.

I experimented with language and localization settings in a very simple iOS app to see if I can trigger such a switch. The app contains a single view controller with a UILabel, created in the storyboard editor.

I tried to change the value of "Localization native development region" in Info.plist. Swedish is not available on the dropdown in the the graphical editor, so I changed it with "Open as Source Code". This simply reads the Swedish label as if it were English text, that is, no difference from doing nothing.

Then I tried ahbou's solution of editing project.pbxproj, replacing the references to "en" with "sv". I redeployed and with this change, but it makes no difference.

I experimented with adding a second non-English locale, and also with checking and unchecking the "Use base localization" option, but this does not make a difference either.

With all the faffing around, it very briefly did start in Swedish, but after turning the rotor back I was never able to trigger the change again.

It occurred to me that there could be a difference between deploying from Xcode and deploying an IPA, so I tried that, no luck.

I tried seeing if I could trigger a VoiceOver language change in a non-minimal app which does not rely on storyboards and which is localised to both English and Swedish. If I edit the schema prior to deploying through Xcode, setting "Application Language" to Swedish and "Application Region" to Sweden causes VoiceOver to start in Swedish for the app, but only setting the Application language does not.

On looking at the AppStore app I have installed that triggers Swedish speech, it looks like the app might be web content displaying inside a web view. Even if that is the case, the fact that it works suggests that there ought to be some way to trigger an automatic switch in a standard iOS app.

Grateful for any ideas!

---- Edited Wednesday February 6, 2019 ----

I experimented with the accessibilityLanguage setting per Mats's helpful suggestion. Setting the language on the UIApplication does propagate it to all elements in the application. I modified the app delegate as follows:

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        application.accessibilityLanguage = "sv"
        return true
    }

Note that the value of isAccessibilityElement is false by default for UIApplication (unlike for the components that users are normally expected to see or interact with). It is not necessary to change it to true in order for the language setting to apply, and I'm not sure what the value of changing it would be as users do not interact with the application directly. I did try setting it to true, which does not appear to make any difference as far as VoiceOver is concerned.

Pacificana
  • 66
  • 8
  • I know you have explained as much as you could but could you maybe tell us what your app exactly does or is supposed to do, what it's not doing, and what you expect it do? – staticVoidMan Feb 05 '19 at 13:30
  • 1
    This isn't about an app I'm writing (the one I'm working on is internationalized). I'm trying to determine what developers who write monolingual apps need to do to get VoiceOver to automatically pick the right language if that app runs on a device whose system language is not the same as the app language. I wrote a trivial app to experiment. – Pacificana Feb 05 '19 at 17:26
  • Then you need to look into [Localization](https://www.appcoda.com/ios-programming-tutorial-localization-apps/) – staticVoidMan Feb 06 '19 at 06:22
  • I think you misunderstand my question. It is common for people the non-English speaking world to have apps in more than one language. For example, as a resident in Sweden, I use public sector apps which are not internationalized, but I have no desire to set Swedish to be my system language. It is not realistic to expect all apps to be localised, but it is realistic that we can find a method to tell VoiceOver what the app's language is. It should be clear from my question that I did attempt a localization to one locale too and that it did not work. – Pacificana Feb 06 '19 at 11:53
  • 1
    Oh ok, so... say an app has written content in Swedish and it's not localized. But you would like the voice-over to read it's content in Swedish voice/pronunciation and not the device's default speech engine, which may be, say UK-English. Is this what you're getting at? – staticVoidMan Feb 06 '19 at 13:22
  • This is one scenario that will cause this scenario to happen, yes. VoiceOver defaults to the system language. – Pacificana Feb 07 '19 at 08:33
  • You can read my blog posts on configuring VoiceOver to manually switching languages here: https://someminorusabilityissues.blogspot.com/2019/02/configuring-ios-screen-reader-voiceover.html and a post which describes a solution based on Mats's suggestion here: https://someminorusabilityissues.blogspot.com/2019/02/how-hard-can-it-be-to-configure-ios.html – Pacificana Feb 07 '19 at 08:39

2 Answers2

1

You can change your preferred language by inspecting the Info.plist file (XCode's GUI editor only allows a few languages), once there modify the next property

<key>CFBundleLocalizations</key>
<array>
    <string>sp</string>
</array>

Instead of sp (code for Spanish), use the locale code you want use. I did this and now VoiceOver language is ubiquitous along the app.

0

You can change the VoiceOver language with the accessibilityLanguage property on any accessibility element. It is documented in the UIAccessibility additions to NSObject.

I think it also affects all sub-elements, so you should only need to set it for your app window.

Mats
  • 8,136
  • 1
  • 24
  • 34
  • Hi Mats, now I've experimented with this. Setting it on the window didn't work, but setting it on the application does. Thank you! – Pacificana Feb 06 '19 at 12:20
  • I blogged about the solution, crediting you as Mats. Happy to mention your full name if you contact me. https://someminorusabilityissues.blogspot.com/2019/02/how-hard-can-it-be-to-configure-ios.html – Pacificana Feb 07 '19 at 08:41