iphonecocoanslocale

Printing the locale names


I want to know and print the locale names which I am changing on my device. Is there any way to print them. Printing a NSLocale object does not help.


Solution

  • Create an NSLocale for the language in which you want the words to appear, then use -displayNameForKey:value: on the NSLocale object to get the display name for the NSLocaleIdentifier key.

    The documentation for this method has an example that shows you exactly what you're looking for.