JonahGabriel
JonahGabriel

Reputation: 3104

Is it possible to localize the CLLocationManager prompt?

While I know it is possible to localize the purpose statement in the UIAlertView that the location manager displays when asking the user for permission for access to their current location I can't seem to find out how to localize the title of the alert that actually says "MyApp Would Like To Use Your Current Location" as well as localizing the button names of "Don't Allow" and "OK".

FYI, to localize the purpose statement, you need to create an InfoPlist.strings file and add the NSLocationUsageDescription = "My reason for asking for your location" as well as adding the NSLocationUsageDescription key to your info.plist file.

Upvotes: 0

Views: 434

Answers (2)

JonahGabriel
JonahGabriel

Reputation: 3104

Turns out that on my simulator the system localization wasn't happening. Works on the device though.

Upvotes: 1

Undo
Undo

Reputation: 25697

No. And yes.

That is a system dialog (generated by CLLocationManager itself), and as such will be automatically localized by the system to the device's current locale. You don't have any control over the title and buttons in the dialog, so you don't need to worry about localizing them.

Upvotes: 1

Related Questions