Localizing system generated privacy alert message iOS UIAlertView Xcode

眉间皱痕 提交于 2019-12-10 18:07:21

问题


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.)


回答1:


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.



来源:https://stackoverflow.com/questions/32567541/localizing-system-generated-privacy-alert-message-ios-uialertview-xcode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!