Re: From BCP-47 to Natural?
Re: From BCP-47 to Natural?
- Subject: Re: From BCP-47 to Natural?
- From: "Gerriet M. Denkmann" <email@hidden>
- Date: Thu, 10 Jul 2014 09:54:35 +0700
On 9 Jul 2014, at 19:27, Kyle Sluder <email@hidden> wrote:
>
> On Tue, Jul 8, 2014, at 09:38 PM, Gerriet M. Denkmann wrote:
>> There are several places where BCP-47 names (like "th-TH", "en-AU" etc.)
>> are used.
>> These are not really usable for users.
>>
>> Is there anywhere some Cocoa library or class which converts these to
>> natural language?
>> Like:
>> "th-TH" → "Thai" or "ไทย"
>> "en-AU" → "Australian English"
>> etc.
>>
>> I could create such a list myself (would be tedious though) - but then I
>> will have a problem if and when Apple implements new languages.
>
> See the documentation for -[NSLocale displayNameForKey:value:]. There's
> a code example in there that does exactly what you're trying to do.
Thanks! This is exactly what I was looking for.
And, now that I know it, NSLocale is kind of the obvious place to look for this functionality.
Kind regards,
Gerriet.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden