• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Changing the Locale for a single App?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Changing the Locale for a single App?


  • Subject: Re: Changing the Locale for a single App?
  • From: mmalcolm crawford <email@hidden>
  • Date: Wed, 17 Dec 2003 10:48:23 -0800

On Dec 17, 2003, at 8:46 AM, Huyler, Christopher M wrote:

I had some problems with this...primarily because I am working with a
Preference Pane and not a stand alone application. So I guess my
question should have been "Changing the Local for a single Preference
Pane". But anyway...

Umm, yes, that makes a difference...

1) You must have the language files for System Preferences (not just my
Preference Pane) to switch the language. So if French support of OSX is
not installed, you cannot switch to French.

The same applies to Catalan, for example:
<http://cocoa.mamasam.com/COCOADEV/2003/11/2/78035.php>

So now my question is...can I select the language to use right when the
bundle is loaded...and only have my Preference Pane be displayed in a
different language? I know it sounds stupid, but that's what I have
been asked to do. Right now I do not have separate Nib files for the
different languages, only a Localizable.strings file if that makes
things easier.

I think Doug's answer covered the implementation basics?

On Dec 16, 2003, at 11:40 AM, Douglas Davidson wrote:

However, it sounds like what you want to do is to select a specific localization from within the running app. For that what you probably want is NSBundle's localization-specific APIs (the ones with forLocalization: in the name). These allow you to locate a resource for a specific localization rather than use NSBundle's default localization selection. What this will not do for you is parse a .strings file, but that is not a large amount of additional work; the standard plist parsing methods will parse .strings files into dictionaries.

What you *might* (untested) do to get the above to work is to register your pane's language preference in its own domain rather than the current app's (System Preferences) -- use:

- (NSDictionary *)persistentDomainForName:(NSString *)domainName
- (void)setPersistentDomain:(NSDictionary *)domain forName:(NSString *)domainName

with domainName @"com.ca.LSPP" or whatever.

I hope that makes sense?

mmalc
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >RE: Changing the Locale for a single App? (From: "Huyler, Christopher M" <email@hidden>)

  • Prev by Date: Re: Changing the Locale for a single App?
  • Next by Date: Re: CoreFoundation on Win32
  • Previous by thread: Re: Changing the Locale for a single App?
  • Next by thread: Re: Changing the Locale for a single App?
  • Index(es):
    • Date
    • Thread