Re: Human readable locale names.
Re: Human readable locale names.
- Subject: Re: Human readable locale names.
- From: Óscar Morales Vivó <email@hidden>
- Date: Thu, 18 Aug 2005 17:44:28 -0400
Thanks a lot, that's just what I needed!
On Aug 18, 2005, at 17:25 , mmalcolm crawford wrote:
On 18 août 05, at 04:31, mmalcolm crawford wrote:
On 18 Aug 2005, at 04:01, mmalcolm crawford wrote:
The following works, although I'm not sure if it's the best way
Hmm, this may be better since it displays the result in the user's
chosen language...
Thank you to Chris P. for pointing out there is a much easier way.
Documentation enhancement request filed... <sigh>
NSLocale * locale = [[NSLocale alloc]
initWithLocaleIdentifier:@"en_GB"];
NSString * displayNameString = [locale
displayNameForKey:NSLocaleIdentifier value:@"en_GB"];
NSLog(@"displayNameString (en_GB) en_GB: %@", displayNameString);
displayNameString = [locale displayNameForKey:NSLocaleIdentifier
value:@"es_ES"];
NSLog(@"displayNameString (en_GB) es_ES: %@", displayNameString);
[locale release];
locale = [[NSLocale alloc] initWithLocaleIdentifier:@"es_ES"];
displayNameString = [locale displayNameForKey:NSLocaleIdentifier
value:@"en_GB"];
NSLog(@"displayNameString (es_ES) en_GB: %@", displayNameString);
displayNameString = [locale displayNameForKey:NSLocaleIdentifier
value:@"es_ES"];
NSLog(@"displayNameString (es_ES) es_ES: %@", displayNameString);
displayNameString (en_GB) en_GB: English (United Kingdom)
displayNameString (en_GB) es_ES: Spanish (Spain)
displayNameString (es_ES) en_GB: inglés (Reino Unido)
displayNameString (es_ES) es_ES: español (España)
mmalc
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden