I\'m creating a Mac app and I want to localize my Labels. I thought a .strings
file would be a better choice. But I have trouble reading .strings
file
NSString *path = [[NSBundle mainBundle] pathForResource:@"Labels" ofType:@"strings"];
NSData *plistData = [NSData dataWithContentsOfFile:path];
NSString *error; NSPropertyListFormat format;
NSDictionary *dictionary = [NSPropertyListSerialization propertyListFromData:plistData
mutabilityOption:NSPropertyListImmutable
format:&format
errorDescription:&error];
NSString *stringname = [dictionary objectForKey:@"LABEL_001"];
I think it will be helpful to you.