4

I have an app in development using Xcode Swift 1.1 and am testing it using iOS 7.1 and iOS 8.1 simulators.

The app allows users to access their photos library, but before they can, iOS displays the Privacy alert message title asking for the user's permission in English language - App Name” Would Like to Access Your Photos. (Side note: the alert is triggered when calling PHAsset and/or ALAssetsLibrary.)

My app will be available in a few different languages, for example, Chinese. However whenever I try to localize or test for different languages settings, the above privacy alert message always shows in English. I want the system privacy alert message to display in the language as set on the user's device.

I’ve tried a number of different location settings and localization languages in Xcode with no difference in the simulator.

Should I expect (or rest easy) that setting a different location on a real device will have iOS automatically show the correct language for all system generated privacy alert messages?

What am I missing in localizing the system privacy alert messages?

(Note: I am unable to test on a real device yet and that setting the "Privacy - Photo Library Usage Description” key in Info.plist does not change the Privacy alert message title, but sets an optional description for the alert instead.)

user4806509
  • 2,925
  • 5
  • 37
  • 72

1 Answers1

5

The ... would like to access your photos permission alert is shown by the system and not by your app. Therefore its localisation is done by the system and not your app's code. You don't have to provide translation strings.

What you are experiencing is a simulator bug. It works on the device. I encourage you to test your app on a real hardware.

Rafał Sroka
  • 39,540
  • 23
  • 113
  • 143
  • 1
    Thank you very much for your answer and explaining what was occurring. I've now managed to test this on a device and indeed the permission alert is localised by the system. Thanks again. Cheers. – user4806509 Sep 24 '15 at 13:58
  • Hi @Bear with me , I've posted a similar question that expands on the above question that you might be able to help solve: http://stackoverflow.com/questions/35344523/localizing-ios-system-generated-messages-in-swift-xcode – user4806509 Feb 11 '16 at 16:18
  • 1
    In current iOS versions, we can add our custom message for Privacy Alerts. So, how can we localise it for different languages? Can you tell me if now the is possible or not? If yes, then how? – Gautam Shrivastav Jan 23 '20 at 05:21
  • @GautamShrivastav please check out this answer: https://stackoverflow.com/questions/25736700/how-to-localise-a-string-inside-the-ios-info-plist-file – Yonathan Goriachnick Jun 13 '21 at 19:27