I am calling Google Maps app to show directions between "Current Location" and another location. I am using the following code,
NSString* url = [NSString stringWithFormat:
@"http://maps.google.com/maps?saddr=%@&daddr=%f,%f"开发者_StackOverflow社区,
@"Current\%20Location",
destCoordinate.latitude, destCoordinate.longitude];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];
Note that I am passing @"Current\%20Location" as saddr. This works fine if my phone's Language is set to English. @pazustep, here, in my post regarding finding Current Location, suggested that this wont work if the Language is different. And obviously, to solve this issue, I have to use Core Location to find the current location and pass the latitude and longitude to Google Maps app. But I am expecting some other way to solve this issue without modifying the implementation logic.
- Is there any built-in API available to translate the string "Current Location" , or any string, into the current phone Language?
- If not, Is there a way to tell Google Maps app to translate the string to the current language?
Why not use core location to get the latitude and longitude of the current location and put that in to saddr?
精彩评论