gnustep-dev
[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: Fri, 13 Aug 2010 11:13:26 +0100


On 13 Aug 2010, at 02:50, asha murthy wrote:

Hi Nicola,

Thank you very much for your kind reply.
defaults write NSGlobalDomain NSLanguages "(Language)"
The above command works for me from command line!

Now, I would like to use this command from my application *.m file.

Is there any way to do this?

Hi Asha

I think the idea is that your application could run in different languages, and the user would select which languages (using 'defaults write ...', or using Preferences.app) he prefers before launching
the application ;-)

By the way, 'defaults write ... ' writes your preferences permanently to disk; you can reboot your computer and your preferred language will still be there - if you selected a language there (eg, French) all GNUstep applications should start up in French, and even if you log out or reboot, they will still come up in French :-)

Anyway, you can still change the language in main.m if you have a reason to do so (I can't really think of a reason, but presumably you have one). You need to use NSUserDefaults to do the equivalent of setting

  NSLanguages = (French, Italian)

(for example) from the shell (note that the value is an NSArray). Check the NSUserDefaults documentation
for an explanation of the API. :-)

Thanks

PS: You can also specify NSLanguages on the command line (for a specific application) if you want, as in

 openapp MyApp.app -NSLanguages '(Italian, French)'

(warning: I haven't tested this command, it may contain a typo)



reply via email to

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