Skip to content

Instantly share code, notes, and snippets.

@casspangell
Created June 29, 2015 20:30
Show Gist options
  • Save casspangell/1b1022d866996ea5ab4b to your computer and use it in GitHub Desktop.
Save casspangell/1b1022d866996ea5ab4b to your computer and use it in GitHub Desktop.
Return all languages used in app
// Return all languages set in app
// The first language is NULL (?)
-(NSMutableArray*)getLanguages {
NSArray *languageArr = [[NSBundle mainBundle] localizations];
for ( int i=1; i<[languageArr count]; i++) {
NSLocale *locale = [[NSLocale alloc] initWithLocaleIdentifier:@"en"];
NSString *lang = [locale displayNameForKey:NSLocaleIdentifier value:[languageArr objectAtIndex:i]];
[self.languageArray addObject:lang];
}
return self.languageArray;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment