Re: Determining current language
Re: Determining current language
- Subject: Re: Determining current language
- From: Douglas Davidson <email@hidden>
- Date: Mon, 26 Sep 2005 13:36:37 -0700
On Sep 26, 2005, at 1:18 PM, Dario Mèndez Musicò wrote:
I'm developing an application which needs to load a specific data
file for each language, so I'm looking for a way to determine which
language is the app actually running...
The easy way to do this is to make these data files localizable
resources in your bundle. Then you just use -[NSBundle
pathForResource:ofType:] to locate the right one.
If for some reason you can't put these files in your bundle, you can
put them in some other bundle, and do the same thing.
If for some reason you can't put them in any bundle, then the right
thing to do is to determine which localization each one corresponds
to (preferably using two-letter codes, e.g. "en", "it", etc.) and use
+[NSBundle preferredLocalizationsFromArray:] to pick the right
localization from the list.
Douglas Davidson
_______________________________________________
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