You can generate pList files for different languages for application.
I'm explaining you sample code for localize language.
NSDictionary *dictLang;
-(void)localization_language{
NSString *errorDesc = nil;
NSPropertyListFormat format;
NSString *rootPath;
if (lang == 1) {
rootPath = [[NSBundle mainBundle] pathForResource:@"FRA"
ofType:@"plist"];
}
else if(lang == 0){
rootPath = [[NSBundle mainBundle] pathForResource:@"ENG"
ofType:@"plist"];
}
NSData *plistXML = [[NSFileManager defaultManager] contentsAtPath:rootPath];
dictLang = (NSDictionary *)[NSPropertyListSerialization propertyListFromData:plistXML mutabilityOption:NSPropertyListMutableContainersAndLeaves format:&format errorDescription:&errorDesc];
NSLog(@"PLIST retrive:%@",plistXML);
if (!dictLang) {
NSLog(@"Error reading plist: %@, format: %d", errorDesc, format);
}
}
This code finds the pList file according to lang variable. 0 for France & 1 for English.
Then, set values from dictionary.
lbl1.text =[dictLang objectForKey:@"Key1"];
lbl2.text =[dictLang objectForKey:@"Key2"];
And it'll display values as per stored in pList file.
Hopefully it'll work for Language Globalization.
Thanks.