I'm pretty stuck with localization inside the app. What is idea:
You choose language inside the app, and depends on which language you choose it save value in NSUserDefaults
. Because I didn't find material for this kind of localization, my idea is to make class that will have class method that return string depending on which language is saved in NSUserDefaults. Example:
+(NSString *) helloString
{
NSString *hello = [NSString new];
if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"language"] isEqualToString:@"en"]) {
hello = @"Hello";
}
else if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"language"] isEqualToString:@"es"]) {
hello = @"Holla!";
}
return hello;
}
Is this legit way, is there any better solution?