Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 10. Interacting with the Environment > Accessing the User’s Locale

Accessing the User’s Locale

From: locale.m

 6 NSLocale *l =
 7    [NSLocale autoupdatingCurrentLocale];
 8 NSString *language =
 9   [l objectForKey: NSLocaleIdentifier];
10 NSString *humanReadableLanguage =
11   [l displayNameForKey: NSLocaleIdentifier
12                  value: language];

If your program interacts with the user directly in any way, you will probably want to localize it at some point. Objective-C provides a lot of rich facilities for doing this.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial