0

I need to set my default (fallback) language from english to non-english . e.g. I have gave support for 3 languages say en,fr,gr . Now if user selects chinese language, then user should be displayed with fr language. Please Help me . I have tried this code

self.strLanguage = [[NSLocale preferredLanguages] objectAtIndex:0];
NSLog(@"strLanguage : %@",self.strLanguage);

NSMutableArray *arraySupportedLanguages = [[NSMutableArray alloc] initWithObjects:@"en",@"fr",@"gr", nil];



NSPredicate *predicate = [NSPredicate predicateWithFormat:@"SELF contains[cd] %@", self.strLanguage];
    arraySupportedLanguages = [[arraySupportedLanguages filteredArrayUsingPredicate:predicate]mutableCopy];

NSLog(@"arraySupportedLanguages : %@",arraySupportedLanguages);

if (arraySupportedLanguages.count == 0) {
                [[NSUserDefaults standardUserDefaults] setObject:@"nl" forKey:@"AppleLanguages"];
        [[NSUserDefaults standardUserDefaults]synchronize];
    }
P.J
  • 6,547
  • 9
  • 44
  • 74
iCoder
  • 1,298
  • 1
  • 9
  • 25
  • check [this other question](http://stackoverflow.com/questions/4072349/non-english-default-language-for-ios-app/4094880#4094880), specially [this answer](http://stackoverflow.com/a/4094880/1411844) – tkanzakic Feb 15 '13 at 08:40
  • But my requirement is different than this solution.I hd already went through this – iCoder Feb 15 '13 at 08:45

0 Answers0