Search code examples
ioslocalizationcore-locationinfo-plist

Localizing iOS Location Permission Prompt


I have a localized app that needs to request user permission to access the device's location. Since iOS 8, this requires a message (defined in Info.plist) stating why the app needs the user's location. I have localized this message successfully, using this technique. I have an InfoPlist.strings file with a foreign-language entry for the key NSLocationWhenInUseUsageDescription:

"NSLocationWhenInUseUsageDescription" = "Este aplicativo pode utilizar a sua localização para servir anúncios que são mais relevantes. Sua identidade não é transmitida com a localização.";

This properly localizes the message explaining why the app needs user location. But, when iOS shows the alert view containing this message, the title of the alert, and the buttons are not localized:

enter image description here

How do I localize the alert's title and button text, too?

I understand how to do all this for a UIAlertView that I show manually, but this alert is shown by the system (iOS).


Solution

  • Did you test on an actual device? I believe the simulator has a bug but it works on real devices.