Re: Determining preferred localizations
Re: Determining preferred localizations
- Subject: Re: Determining preferred localizations
- From: Gregory Weston <email@hidden>
- Date: Wed, 21 Apr 2010 16:54:13 -0400
Gary L. Wade wrote:
>The list you are getting is a set of preferred localizations, so when trying
>to get a resource from the first one, if not available, will go on to the
>next one and so forth.
>
>You should utilize the localization-aware methods to handle getting
>resources rather than trying to manage this yourself. There's really only
>two reasons I've encountered a need for this kind of granularity, the first
>where you're forced to use a set of legacy resources that you're unable to
>move into the right places, and the second a localization utility.
I think one of us has misunderstood, because I'm not sure how this response actually addresses my question. I'll restate and try to be more clear.
I'm trying to present to the user a list of the attached displays. For any given display device, the "name" I get from IOKit is not a string but a dictionary mapping locale identifiers to localized versions of the device name. My goal is to determine which of the dictionary entries to use.
I thought NSBundle's preferredLocalizationsFromArray: and CFBundleCopyPreferredLocalizationsFromArray() would take an array made up of those dictionary keys and give me back a subset of the list, prioritized based on such things as the user's localization settings and the available localizations within the app. What I'm getting is an array containing a single entry which doesn't match the app's development region, doesn't match any set of localization resources in the app and is at an unpredictable (although consistent per machine) offset in the user's preferred language list.
System Profiler and the Displays pref pane both show the appropriate value. I'm sure I'm doing something wrong but I don't know what.
Short form: How do I get from an NSScreen or a CGDirectDisplayID to the most appropriate human-readable name for the display?
Greg
_______________________________________________
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