Re: From BCP-47 to Natural?
Re: From BCP-47 to Natural?
- Subject: Re: From BCP-47 to Natural?
- From: Kyle Sluder <email@hidden>
- Date: Tue, 08 Jul 2014 22:00:46 -0500
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.
--Kyle Sluder
_______________________________________________
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