Re: Changing the app language
Re: Changing the app language
- Subject: Re: Changing the app language
- From: Brian Willoughby <email@hidden>
- Date: Sat, 28 Jul 2007 11:23:04 -0700
On Jul 27, 2007, at 19:59, Jeff Bland wrote:
This indeed changed the application language off my system default
language, and worked exactly as expected with one exception - it
doesn't take effect until the application restarts. I suppose some
internal settings need to be flushed or something for
NSLocalizedString to update the strings file it reads from, I don't
know how or if it's possible to change that.
Cocoa / AppKit create highly cached data structure and user interface
objects. You may find that a newly loaded nibs will show the new
language selection. Unlike Win32, AppKit does not parse things
repeatedly, but rather caches the results after reading the input
file only once. The only disadvantage of this is a larger memory
footprint. It's the typical memory vs. speed tradeoff.
So I have the choice of seeking and reading the strings file as
Douglas proposed, but not having my save panels and the like be
translated, or changing the language preference under the
application domain, as Brian proposed, and not getting real time
switching.
It's highly unlikely that a user of your application will learn a new
language during a single session. Restarting the application is not
unreasonable in this bizarre case.
Alastair asked my reasons for supporting such an option. I don't
have a particular need for it in my current project - it's just a
feature that I like and want to include. Which should be enough
reason. In this case, either behavior listed above is acceptable
since it's not vital to the program, but I'm still gonna play with
NSUserDefaults some more.
While this whole subject is an interesting learning exercise, I tend
to agree with the others who have said that there really is no
realistic situation in which a user would actually need to change the
language for a single application like you're trying to enable.
You're fighting a few central behaviors of AppKit. Maybe you could
put your time into something else a little more promising?
Brian Willoughby
Sound Consulting
_______________________________________________
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