Skip to content

Instantly share code, notes, and snippets.

@Morse-Code
Created April 5, 2013 11:01
Show Gist options
  • Save Morse-Code/5318448 to your computer and use it in GitHub Desktop.
Save Morse-Code/5318448 to your computer and use it in GitHub Desktop.
Getting a locale to match the user's language preference.
/*
Getting a locale to match the user's language preference
*/
// You’d think you could just use:
[NSLocale currentLocale];
// But you’d be wrong. Instead, go with:
[[NSLocale alloc] initWithLocaleIdentifier:[NSLocale preferredLanguages][0]];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment