There is a way:
First create another folder named ar.lproj
and put localizable.String
May follow the sample code example. You can call this function in viewWillAppear
with the key for which you need to get the value.
-(NSString*) languageSelectedStringForKey:(NSString*) key { NSString *path; NSUserDefaults *userDefault = [NSUserDefaults standardUserDefaults]; if([[userDefault valueForKey:@"language_Selected"] intValue] == 0) path = [[NSBundle mainBundle] pathForResource:@"en" ofType:@"lproj"]; else if([[userDefault valueForKey:@"language_Selected"] intValue] == 1) path = [[NSBundle mainBundle] pathForResource:@"ar" ofType:@"lproj"]; NSBundle* languageBundle = [NSBundle bundleWithPath:path]; NSString* str=[[languageBundle localizedStringForKey:key value:@"" table:nil] retain]; return str; }
I hope you understand the concept.
source share