0

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.

Nimantha
  • 6,405
  • 6
  • 28
  • 69
Abhinav
  • 37,684
  • 43
  • 191
  • 309

1 Answers1

1

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.

Dave DeLong
  • 242,470
  • 58
  • 448
  • 498
  • It worked. Thanks... but here I had to give my own values... like fr_FR and en_US. I was thinking if there is a way to directly print locale names from the NSLocale object. Because if from device I have chosen the French locale but in code I am trying to print with en_US, a wrong locale name is being printed. – Abhinav Dec 29 '10 at 21:06