discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem running hello-objc-gnustep example in gettext


From: Nicola Pero
Subject: Re: Problem running hello-objc-gnustep example in gettext
Date: Sat, 21 Aug 2010 20:25:18 +0200 (CEST)

> $ myApp -NSLanguages='(French, Italian)'

Yes, I think most likely Asha should use this. :-)


> That's fine ... but I think the idea was to do it programatically from within 
> the > app itsself.
>
> [...]
>
> If you want to override any defaults set anywhere else ... then the code is a 
> bit 
> more complex as you need to set a default in a new domain and make that 
> domain 
> have highest precedence.
>
> [...]
>

I tried your code out, and with a couple of very minor tweaks, it does work! :-)


Here's a tested version --

NSUserDefaults *defs = [NSUserDefaults standardUserDefaults];
NSMutableArray *list = [[[defs searchList] mutableCopy] autorelease];
     
[defs setVolatileDomain: [NSDictionary dictionaryWithObjectsAndKeys: [NSArray 
arrayWithObject: @"French"], @"NSLanguages", nil]
                forName: @"MyDomain"];
[list insertObject: @"MyDomain"  atIndex: 0];
[defs setSearchList: list];


Unfortunately, it does not really make that much sense to use this code.  It 
would force the application to always run in French (in the example), ignoring 
any user preferences, defaults, or even command-line switches. :-(

Thanks




reply via email to

[Prev in Thread] Current Thread [Next in Thread]