Search code examples
ioslocalizationios11uiactivityviewcontroller

Why UIActivityViewController doesn't display localized cancel string?


As shown in the following screenshot:

enter image description here

Although the device language has been set to Arabic (you could recognize it by checking the status bar and the activity view controller title). However, the cancel button still has the "Cancel" title; Since we are unable to change its title, I assume it should automatically changed depends on the device language -which is Arabic in my case- (to be localized), as mentioned in the this answer.

What am I missing here?


Solution

  • I found a solution which worked for me with my device language set to Arabic.
    Go to your Info.plist and add Localized resources can be mixed with Boolean YES to it.

    As mentioned in Core Foundation Keys:

    CFBundleAllowMixedLocalizations

    CFBundleAllowMixedLocalizations (Boolean - iOS, macOS) specifies whether the bundle supports the retrieval of localized strings from frameworks. This key is used primarily by Foundation tools that link to other system frameworks and want to retrieve localized resources from those frameworks.