Last active
December 17, 2015 18:59
-
-
Save jamesstout/5657562 to your computer and use it in GitHub Desktop.
List Lithuanian locales in OS X
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
NSArray *test = [NSLocale availableLocaleIdentifiers]; | |
for (int i = 0; i < [test count]; i++) { | |
NSLocale *tmpLocale = [[[NSLocale alloc] initWithLocaleIdentifier:[test objectAtIndex:i]] autorelease]; | |
NSString *localeIdentifier = [tmpLocale objectForKey: NSLocaleIdentifier]; | |
NSString *localeIdentifierDisplayName = [tmpLocale displayNameForKey:NSLocaleIdentifier value:localeIdentifier]; | |
if( [localeIdentifier hasPrefix:@"lt"]){ | |
NSLog(@"localeIdentifierDisplayName = %@", localeIdentifierDisplayName); | |
NSLog(@"localeIdentifier = %@", localeIdentifier); | |
} | |
} |
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
2013-05-27 22:57:08.668 ImageOptim[60903:303] localeIdentifierDisplayName = lietuvių (Lietuva) | |
2013-05-27 22:57:08.669 ImageOptim[60903:303] localeIdentifier = lt_LT | |
2013-05-27 22:57:08.681 ImageOptim[60903:303] localeIdentifierDisplayName = lietuvių | |
2013-05-27 22:57:08.682 ImageOptim[60903:303] localeIdentifier = lt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment