私のiPhoneアプリは、ユーザーの緯度と経度に基づいてアドレスを解決することになっています。reverseGeocodeLocationは正常に機能しますが、結果は英語です。
結果を他の言語にローカライズする方法はありますか?
アップルや他の場所でそれに関する情報を見つけることができませんでした。
私が使用するコードは次のとおりです。
CLGeocoder *geocoder = [[[CLGeocoder alloc] init] autorelease];
CLLocation *location = [[[CLLocation alloc]
initWithLatitude:coord.latitude longitude:coord.longitude] autorelease];
[geocoder reverseGeocodeLocation:location completionHandler:^(NSArray *placemarks, NSError *error) {
NSLog(@"reverseGeocodeLocation:completionHandler: Completion Handler called!");
if (error){
NSLog(@"Geocode failed with error: %@", error);
[self displayError:error];
return;
}
if(placemarks && placemarks.count > 0)
{
//do something
CLPlacemark *topResult = [placemarks objectAtIndex:0];
NSString *addressTxt = [NSString stringWithFormat:@"%@ %@,%@ %@",
[topResult subThoroughfare],[topResult thoroughfare],
[topResult locality], [topResult administrativeArea]];
}
}