Created
June 29, 2015 20:30
-
-
Save casspangell/1b1022d866996ea5ab4b to your computer and use it in GitHub Desktop.
Return all languages used in app
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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