Not sure, if I get you right. You need the locale name of each field - e.g. the locale translation, in french, german, etc?
In general there are not to much fields for addresses - see: ABPerson.h header file:
// Addresses
extern const ABPropertyID kABPersonAddressProperty; // Street address - kABMultiDictionaryPropertyType
extern const CFStringRef kABPersonAddressStreetKey;
extern const CFStringRef kABPersonAddressCityKey;
extern const CFStringRef kABPersonAddressStateKey;
extern const CFStringRef kABPersonAddressZIPKey;
extern const CFStringRef kABPersonAddressCountryKey;
extern const CFStringRef kABPersonAddressCountryCodeKey;
And if you need the field name (cause there could be personal fantasy names ;) ), be sure to use ABAddressBookCopyLocalizedLabel like this:
CFStringRef label = ABAddressBookCopyLocalizedLabel(ABMultiValueCopyLabelAtIndex(multiValue, j));
Maybe you like to clarify your question, if I got you wrong.
jimmy
EDIT:
Ok, I'm still not sure if I got you right, but I will answer 'both' ways I got you ;)
The first is that you want the generic field names (locale independent) - you can get those (in the current locale of you project) that way: The code is using NSArrays and NSDictionaries depending of the entry of the address book card:
- (void) logAddressBook {
ABAddressBookRef addressBook = ABAddressBookCreate();
NSArray *addresses = (NSArray *) ABAddressBookCopyArrayOfAllPeople(addressBook);
int i;
for(i = 0; i < [addresses count]; i++) {
ABRecordRef record = [addresses objectAtIndex:i];
NSString *firstName = (NSString *)ABRecordCopyValue(record, kABPersonFirstNameProperty);
NSString *lastName = (NSString *)ABRecordCopyValue(record, kABPersonLastNameProperty);
NSLog(@"%@, %@", lastName, firstName);
ABMultiValueRef multiValue = ABRecordCopyValue(record, kABPersonEmailProperty);
int count = ABMultiValueGetCount(multiValue);
int j;
for(j = 0; j < count; j++) {
CFStringRef label = ABAddressBookCopyLocalizedLabel(ABMultiValueCopyLabelAtIndex(multiValue, j));
NSString *value = (NSString *)ABMultiValueCopyValueAtIndex(multiValue, j);
NSLog(@"Email for %@: %@", label, value);
CFRelease(label);
}
//Get the contact´s addresses
CFTypeRef adressesReference = ABRecordCopyValue((ABRecordRef)record, kABPersonAddressProperty);
CFIndex mvCount = ABMultiValueGetCount(adressesReference);
if (mvCount > 0) {
NSLog(@"Addresses: ");
for (j=0; j < mvCount; j++) {
CFStringRef key = ABAddressBookCopyLocalizedLabel(ABMultiValueCopyLabelAtIndex(adressesReference, j));
NSDictionary *values = (NSDictionary *)ABMultiValueCopyValueAtIndex(adressesReference, j);
NSLog(@"%@ - ", key);
NSEnumerator *enumerator = [values keyEnumerator];
id innerKey;
while ((innerKey = [enumerator nextObject])) {
/* code that uses the returned key */
NSString *value = (NSString *)[values objectForKey: innerKey];
CFStringRef innerKeyLabel = ABAddressBookCopyLocalizedLabel((CFStringRef)innerKey);
NSLog(@"key: %@ -> value: %@", innerKeyLabel, value);
}
}
}
CFRelease(adressesReference);
}
}
Look at the log and you see how to get all labels and values you like - just extend the code to the fields you want.
The other part of my answer: I wonder if you just wanted to see the labels in the different languages a user might have as locale. Such as french, german, etc. If you want to see this (having ABAddressBookCopyLocalizedLabel to use different languages) I only found 'Localization native development region' in the .plist file of the project. If you change this, the translation is changed. Showing you the labels in the users language.
I'm not sure if it is possible to change this programmatically. If you know a way, let me know ;)
So, I hope this helped an you like my corrected answer :)
Jimmy